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_remove.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_remove.cpp')
-rw-r--r-- | src/modules/m_remove.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/modules/m_remove.cpp b/src/modules/m_remove.cpp index 95c454347..36f056451 100644 --- a/src/modules/m_remove.cpp +++ b/src/modules/m_remove.cpp @@ -77,7 +77,7 @@ class RemoveBase } } - void Handle (const char** parameters, int pcnt, userrec *user, bool neworder) + CmdResult Handle (const char** parameters, int pcnt, userrec *user, bool neworder) { const char* channame; const char* username; @@ -108,13 +108,13 @@ class RemoveBase if (!target || !channel) { user->WriteServ("401 %s %s :No such nick/channel", user->nick, !target ? username : channame); - return; + return CMD_FAILURE; } if (!channel->HasUser(target)) { user->WriteServ( "NOTICE %s :*** The user %s is not on channel %s", user->nick, target->nick, channel->name); - return; + return CMD_FAILURE; } /* This is adding support for the +q and +a channel modes, basically if they are enabled, and the remover has them set. @@ -206,13 +206,17 @@ class RemoveBase else { user->WriteServ( "NOTICE %s :*** You do not have access to /remove %s from %s", user->nick, target->nick, channel->name); + return CMD_FAILURE; } } else { /* m_nokicks.so was loaded and +Q was set, block! */ user->WriteServ( "484 %s %s :Can't remove user %s from channel (+Q set)", user->nick, channel->name, target->nick); + return CMD_FAILURE; } + + return CMD_SUCCESS; } }; @@ -225,9 +229,9 @@ class cmd_remove : public command_t, public RemoveBase syntax = "<nick> <channel> [<reason>]"; } - void Handle (const char** parameters, int pcnt, userrec *user) + CmdResult Handle (const char** parameters, int pcnt, userrec *user) { - RemoveBase::Handle(parameters, pcnt, user, false); + return RemoveBase::Handle(parameters, pcnt, user, false); } }; @@ -240,9 +244,9 @@ class cmd_fpart : public command_t, public RemoveBase syntax = "<channel> <nick> [<reason>]"; } - void Handle (const char** parameters, int pcnt, userrec *user) + CmdResult Handle (const char** parameters, int pcnt, userrec *user) { - RemoveBase::Handle(parameters, pcnt, user, true); + return RemoveBase::Handle(parameters, pcnt, user, true); } }; |