3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-29 07:29:31 +01:00

review fix

This commit is contained in:
Shivaram Lingamneni 2020-07-09 04:33:09 -04:00
parent 6ea2eb367d
commit 8dd25f66bc
3 changed files with 7 additions and 3 deletions

View File

@ -707,7 +707,7 @@ func (channel *Channel) Join(client *Client, key string, isSajoin bool, rb *Resp
} }
if details.account == "" && if details.account == "" &&
(channel.flags.HasMode(modes.RegisteredOnly) || channel.server.Defcon() <= 3) { (channel.flags.HasMode(modes.RegisteredOnly) || channel.server.Defcon() <= 2) {
return errRegisteredOnly return errRegisteredOnly
} }
} }

View File

@ -2067,6 +2067,10 @@ func dispatchMessageToTarget(client *Client, tags map[string]string, histType hi
tnick := tDetails.nick tnick := tDetails.nick
details := client.Details() details := client.Details()
if details.account == "" && server.Defcon() <= 3 {
rb.Add(nil, server.name, ERR_NEEDREGGEDNICK, client.Nick(), tnick, client.t("Direct messages from unregistered users are temporarily restricted"))
return
}
nickMaskString := details.nickMask nickMaskString := details.nickMask
accountName := details.accountName accountName := details.accountName
var deliverySessions []*Session var deliverySessions []*Session

View File

@ -175,8 +175,8 @@ spam or other hostile activity. It has five levels, which are cumulative
5: Normal operation 5: Normal operation
4: No new account or channel registrations 4: No new account or channel registrations
3: All channels are +R; no changes to vhosts 3: All users are +R; no changes to vhosts
2: No new unauthenticated connections 2: No new unauthenticated connections; all channels are +R
1: No new connections except from localhost or other trusted IPs`, 1: No new connections except from localhost or other trusted IPs`,
}, },
"deoper": { "deoper": {