summaryrefslogtreecommitdiff
path: root/src/modules/m_sapart.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-09-15 20:43:05 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-09-15 20:43:05 +0000
commite166642755b17a56053d57dbd597e2fa38bb96c6 (patch)
tree0d54ed15ca1189554a32282e1df1a367f3c2ddc4 /src/modules/m_sapart.cpp
parent1b1792b1c9a83e2b76c6e51b3a2ef61a15f99897 (diff)
Proper checking in /SAPART that the user really did leave, for the CMD_FAILURE and CMD_SUCCESS return values (see SAJOIN)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5264 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_sapart.cpp')
-rw-r--r--src/modules/m_sapart.cpp21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/modules/m_sapart.cpp b/src/modules/m_sapart.cpp
index 36078ab06..b5f97a66a 100644
--- a/src/modules/m_sapart.cpp
+++ b/src/modules/m_sapart.cpp
@@ -49,9 +49,28 @@ class cmd_sapart : public command_t
user->WriteServ("990 %s :Cannot use an SA command on a u-lined client",user->nick);
return CMD_FAILURE;
}
- ServerInstance->WriteOpers(std::string(user->nick)+" used SAPART to make "+dest->nick+" part "+parameters[1]);
+
if (!channel->PartUser(dest, dest->nick))
delete channel;
+ chanrec* n = ServerInstance->FindChan(parameters[1]);
+ if (!n)
+ {
+ ServerInstance->WriteOpers(std::string(user->nick)+" used SAPART to make "+dest->nick+" part "+parameters[1]);
+ return CMD_SUCCESS;
+ }
+ else
+ {
+ if (!n->HasUser(dest))
+ {
+ ServerInstance->WriteOpers(std::string(user->nick)+" used SAPART to make "+dest->nick+" part "+parameters[1]);
+ return CMD_SUCCESS;
+ }
+ else
+ {
+ user->WriteServ("NOTICE %s :*** Unable to make %s part %s",user->nick, dest->nick, parameters[1]);
+ return CMD_FAILURE;
+ }
+ }
return CMD_SUCCESS;
}