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_uninvite.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_uninvite.cpp')
-rw-r--r-- | src/modules/m_uninvite.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/modules/m_uninvite.cpp b/src/modules/m_uninvite.cpp index 88d8f4707..b967b3496 100644 --- a/src/modules/m_uninvite.cpp +++ b/src/modules/m_uninvite.cpp @@ -38,7 +38,7 @@ class cmd_uninvite : public command_t syntax = "<nick> <channel>"; } - void Handle (const char** parameters, int pcnt, userrec *user) + CmdResult Handle (const char** parameters, int pcnt, userrec *user) { userrec* u = ServerInstance->FindNick(parameters[0]); chanrec* c = ServerInstance->FindChan(parameters[1]); @@ -54,7 +54,7 @@ class cmd_uninvite : public command_t user->WriteServ("401 %s %s :No such nick/channel",user->nick, parameters[0]); } - return; + return CMD_FAILURE; } if (c->modes[CM_INVITEONLY]) @@ -62,7 +62,7 @@ class cmd_uninvite : public command_t if (c->GetStatus(user) < STATUS_HOP) { user->WriteServ("482 %s %s :You must be at least a half-operator to change modes on this channel",user->nick, c->name); - return; + return CMD_FAILURE; } } @@ -71,18 +71,20 @@ class cmd_uninvite : public command_t if (!u->IsInvited(xname)) { user->WriteServ("491 %s %s %s :Is not invited to channel %s",user->nick,u->nick,c->name,c->name); - return; + return CMD_FAILURE; } if (!c->HasUser(user)) { user->WriteServ("492 %s %s :You're not on that channel!",user->nick, c->name); - return; + return CMD_FAILURE; } u->RemoveInvite(xname); user->WriteServ("494 %s %s %s :Uninvited",user->nick,c->name,u->nick); u->WriteServ("493 %s :You were uninvited from %s by %s",u->nick,c->name,user->nick); c->WriteChannelWithServ(ServerInstance->Config->ServerName, "NOTICE %s :*** %s uninvited %s.", c->name, user->nick, u->nick); + + return CMD_SUCCESS; } }; |