aboutsummaryrefslogtreecommitdiff
path: root/src/commands/cmd_nick.cpp
diff options
context:
space:
mode:
authorGravatar w00t2008-11-01 23:58:33 +0000
committerGravatar w00t2008-11-01 23:58:33 +0000
commitb15038c4c3109fa4e326ef657493e08bbbc6881d (patch)
tree2fdc2b70172565f3c609a0a5de6ab7f63c2fcf1f /src/commands/cmd_nick.cpp
parentCorrect this error message to confuse people less. (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_nick.cpp')
-rw-r--r--src/commands/cmd_nick.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/commands/cmd_nick.cpp b/src/commands/cmd_nick.cpp
index 25b2868ec..a48cf53a9 100644
--- a/src/commands/cmd_nick.cpp
+++ b/src/commands/cmd_nick.cpp
@@ -103,6 +103,19 @@ CmdResult CommandNick::Handle (const std::vector<std::string>& parameters, User
user->WriteNumeric(432, "%s %s :Invalid nickname: %s",user->nick.c_str(), parameters[0].c_str(), mq->reason);
return CMD_FAILURE;
}
+
+ if (ServerInstance->Config->RestrictBannedUsers)
+ {
+ for (UCListIter i = user->chans.begin(); i != user->chans.end(); i++)
+ {
+ Channel *chan = i->first;
+ if (chan->GetStatus(user) < STATUS_VOICE && 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;
+ }
+ }
+ }
}
/*