From 8dd25f66bc52c11708bc7e57743b32a8e3f8f98a Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni Date: Thu, 9 Jul 2020 04:33:09 -0400 Subject: [PATCH] review fix --- irc/channel.go | 2 +- irc/handlers.go | 4 ++++ irc/help.go | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/irc/channel.go b/irc/channel.go index 199c55d0..4e1aee85 100644 --- a/irc/channel.go +++ b/irc/channel.go @@ -707,7 +707,7 @@ func (channel *Channel) Join(client *Client, key string, isSajoin bool, rb *Resp } if details.account == "" && - (channel.flags.HasMode(modes.RegisteredOnly) || channel.server.Defcon() <= 3) { + (channel.flags.HasMode(modes.RegisteredOnly) || channel.server.Defcon() <= 2) { return errRegisteredOnly } } diff --git a/irc/handlers.go b/irc/handlers.go index 65883232..6b57fb9e 100644 --- a/irc/handlers.go +++ b/irc/handlers.go @@ -2067,6 +2067,10 @@ func dispatchMessageToTarget(client *Client, tags map[string]string, histType hi tnick := tDetails.nick 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 accountName := details.accountName var deliverySessions []*Session diff --git a/irc/help.go b/irc/help.go index 402dd3e3..77940f35 100644 --- a/irc/help.go +++ b/irc/help.go @@ -175,8 +175,8 @@ spam or other hostile activity. It has five levels, which are cumulative 5: Normal operation 4: No new account or channel registrations -3: All channels are +R; no changes to vhosts -2: No new unauthenticated connections +3: All users are +R; no changes to vhosts +2: No new unauthenticated connections; all channels are +R 1: No new connections except from localhost or other trusted IPs`, }, "deoper": {