diff options
author | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-05-11 18:04:53 +0000 |
---|---|---|
committer | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-05-11 18:04:53 +0000 |
commit | 1886d90944c312deb2f33a18e2571a1bbb373601 (patch) | |
tree | b94ea636c5fb54e10fe84cd56355c781214a8ef9 /src/modules | |
parent | 5ec889c7e564e020eb00cf14b8958a9cb37c0702 (diff) |
Clear up logic a little here, check error conditions at the top, succeed at the bottom. Little neater :)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6974 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/m_knock.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/modules/m_knock.cpp b/src/modules/m_knock.cpp index d850ed35b..70480e188 100644 --- a/src/modules/m_knock.cpp +++ b/src/modules/m_knock.cpp @@ -56,18 +56,14 @@ class cmd_knock : public command_t } line = line + std::string(parameters[pcnt-1]); - if (c->modes[CM_INVITEONLY]) - { - c->WriteChannelWithServ((char*)ServerInstance->Config->ServerName, "NOTICE %s :User %s is KNOCKing on %s (%s)", c->name, user->nick, c->name, line.c_str()); - user->WriteServ("NOTICE %s :KNOCKing on %s",user->nick,c->name); - return CMD_SUCCESS; - } - else + if (!c->modes[CM_INVITEONLY]) { user->WriteServ("480 %s :Can't KNOCK on %s, channel is not invite only so knocking is pointless!",user->nick, c->name); return CMD_FAILURE; } + c->WriteChannelWithServ((char*)ServerInstance->Config->ServerName, "NOTICE %s :User %s is KNOCKing on %s (%s)", c->name, user->nick, c->name, line.c_str()); + user->WriteServ("NOTICE %s :KNOCKing on %s",user->nick,c->name); return CMD_SUCCESS; } }; |