From e166642755b17a56053d57dbd597e2fa38bb96c6 Mon Sep 17 00:00:00 2001 From: brain Date: Fri, 15 Sep 2006 20:43:05 +0000 Subject: 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 --- src/modules/m_sapart.cpp | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'src/modules') 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; } -- cgit v1.2.3