diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-09-06 17:58:59 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-09-06 17:58:59 +0000 |
commit | 71ad308979d9c9129507fdf85d4305fd12e18bea (patch) | |
tree | 6aaebc6d1fb6e4c49a2adf474bf4592e2d89a5e8 /src/modules/m_knock.cpp | |
parent | 4cf0ae1308fe98757de42ffbe391e61844ac9e0a (diff) |
All commands now return results CMD_FAILURE or CMD_SUCCESS
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5150 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_knock.cpp')
-rw-r--r-- | src/modules/m_knock.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/modules/m_knock.cpp b/src/modules/m_knock.cpp index 68bcde9a2..3a104bb67 100644 --- a/src/modules/m_knock.cpp +++ b/src/modules/m_knock.cpp @@ -31,20 +31,20 @@ using namespace std; class cmd_knock : public command_t { public: - cmd_knock (InspIRCd* Instance) : command_t(Instance,"KNOCK", 0, 2) + cmd_knock (InspIRCd* Instance) : command_t(Instance,"KNOCK", 0, 2) { this->source = "m_knock.so"; syntax = "<channel> <reason>"; } - void Handle (const char** parameters, int pcnt, userrec *user) + CmdResult Handle (const char** parameters, int pcnt, userrec *user) { chanrec* c = ServerInstance->FindChan(parameters[0]); if (!c) { user->WriteServ("401 %s %s :No such channel",user->nick, parameters[0]); - return; + return CMD_FAILURE; } std::string line = ""; @@ -52,7 +52,7 @@ class cmd_knock : public command_t if (c->IsModeSet('K')) { user->WriteServ("480 %s :Can't KNOCK on %s, +K is set.",user->nick, c->name); - return; + return CMD_FAILURE; } for (int i = 1; i < pcnt - 1; i++) @@ -65,13 +65,15 @@ class cmd_knock : public command_t { 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; + return CMD_SUCCESS; } else { user->WriteServ("480 %s :Can't KNOCK on %s, channel is not invite only so knocking is pointless!",user->nick, c->name); - return; + return CMD_FAILURE; } + + return CMD_SUCCESS; } }; |