diff options
author | attilamolnar <attilamolnar@hush.com> | 2012-09-13 01:01:05 +0200 |
---|---|---|
committer | attilamolnar <attilamolnar@hush.com> | 2012-09-13 01:07:02 +0200 |
commit | 2ef3dffd4781082988ffaaab3d786733b1b96a18 (patch) | |
tree | c0548909bc71bea1a4d90e0e18385664b643880e /src/commands | |
parent | 3af395f6a1c4679ac30b7a06bf7890f598d68047 (diff) |
Don't allow banned users to NOTICE a channel when security:restrictbannedusers is on
Fixes #297 reported by @killerrabbit
Diffstat (limited to 'src/commands')
-rw-r--r-- | src/commands/cmd_notice.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/commands/cmd_notice.cpp b/src/commands/cmd_notice.cpp index e10d6286d..b060a534f 100644 --- a/src/commands/cmd_notice.cpp +++ b/src/commands/cmd_notice.cpp @@ -110,6 +110,15 @@ CmdResult CommandNotice::Handle (const std::vector<std::string>& parameters, Use user->WriteNumeric(404, "%s %s :Cannot send to channel (+m)", user->nick.c_str(), chan->name.c_str()); return CMD_FAILURE; } + + if (ServerInstance->Config->RestrictBannedUsers) + { + if (chan->IsBanned(user)) + { + user->WriteNumeric(404, "%s %s :Cannot send to channel (you're banned)", user->nick.c_str(), chan->name.c_str()); + return CMD_FAILURE; + } + } } ModResult MOD_RESULT; |