From febd2b04e58346f76b6a0c7c028b6915b27d95fb Mon Sep 17 00:00:00 2001 From: w00t Date: Wed, 15 Feb 2006 02:58:20 +0000 Subject: - Check for +K before bothing to assemble knock message git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3208 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_knock.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src') 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()); -- cgit v1.2.3