summaryrefslogtreecommitdiff
path: root/src/commands/cmd_privmsg.cpp
diff options
context:
space:
mode:
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-11-01 23:58:33 +0000
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-11-01 23:58:33 +0000
commitb15038c4c3109fa4e326ef657493e08bbbc6881d (patch)
tree2fdc2b70172565f3c609a0a5de6ab7f63c2fcf1f /src/commands/cmd_privmsg.cpp
parent3c93d5d1c46953ad152f619885c4f3678d4a3ecc (diff)
Obsolete m_restrictbanned, add <security:restrictbannedusers>, default on.. this is insane to leave off, really, but allow it anyway.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10785 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/commands/cmd_privmsg.cpp')
-rw-r--r--src/commands/cmd_privmsg.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/commands/cmd_privmsg.cpp b/src/commands/cmd_privmsg.cpp
index 7354307fe..a11e53dfb 100644
--- a/src/commands/cmd_privmsg.cpp
+++ b/src/commands/cmd_privmsg.cpp
@@ -68,18 +68,28 @@ CmdResult CommandPrivmsg::Handle (const std::vector<std::string>& parameters, Us
if (chan)
{
- if (IS_LOCAL(user))
+ if (IS_LOCAL(user) && chan->GetStatus(user) < STATUS_VOICE)
{
- if ((chan->IsModeSet('n')) && (!chan->HasUser(user)))
+ if (chan->IsModeSet('n') && !chan->HasUser(user))
{
user->WriteNumeric(404, "%s %s :Cannot send to channel (no external messages)", user->nick.c_str(), chan->name.c_str());
return CMD_FAILURE;
}
- if ((chan->IsModeSet('m')) && (chan->GetStatus(user) < STATUS_VOICE))
+
+ if (chan->IsModeSet('m'))
{
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;
+ }
+ }
}
int MOD_RESULT = 0;