summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/modules/m_knock.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/modules/m_knock.cpp b/src/modules/m_knock.cpp
index bd6049718..fa4ee68bb 100644
--- a/src/modules/m_knock.cpp
+++ b/src/modules/m_knock.cpp
@@ -40,17 +40,18 @@ class cmd_knock : public command_t
chanrec* c = Srv->FindChannel(parameters[0]);
std::string line = "";
+ if (c->IsCustomModeSet('K'))
+ {
+ WriteServ(user->fd,"480 %s :Can't KNOCK on %s, +K is set.",user->nick, c->name);
+ return;
+ }
+
for (int i = 1; i < pcnt - 1; i++)
{
line = line + std::string(parameters[i]) + " ";
}
line = line + std::string(parameters[pcnt-1]);
- if (c->IsCustomModeSet('K'))
- {
- WriteServ(user->fd,"480 %s :Can't KNOCK on %s, +K is set.",user->nick, c->name);
- return;
- }
if (c->binarymodes & CM_INVITEONLY)
{
WriteChannelWithServ((char*)Srv->GetServerName().c_str(),c,"NOTICE %s :User %s is KNOCKing on %s (%s)",c->name,user->nick,c->name,line.c_str());