]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_sapart.cpp
Increase the size of the matrix for map drawing to 250x250
[user/henk/code/inspircd.git] / src / modules / m_sapart.cpp
index 05fe5ffdc0c1d6d1bbc7683172ff9f6ef07e67d8..8fba733595c802e3088d168c08a87811e9b3e457 100644 (file)
@@ -31,18 +31,16 @@ class CommandSapart : public Command
        {
                User* dest = ServerInstance->FindNick(parameters[0]);
                Channel* channel = ServerInstance->FindChan(parameters[1]);
-               std::string reason;
+               std::string reason = "";
 
                if (dest && channel)
                {
-                       if (parameters.size() == 3)
+                       if (parameters.size() > 2)
                                reason = parameters[2];
-                       else
-                               reason = dest->nick;
 
                        if (ServerInstance->ULine(dest->server))
                        {
-                               user->WriteNumeric(990, "%s :Cannot use an SA command on a u-lined client",user->nick.c_str());
+                               user->WriteNumeric(ERR_NOPRIVILEGES, "%s :Cannot use an SA command on a u-lined client",user->nick.c_str());
                                return CMD_FAILURE;
                        }
 
@@ -52,8 +50,9 @@ class CommandSapart : public Command
                         */
                        if (IS_LOCAL(dest))
                        {
-                               if (!channel->PartUser(dest, reason.c_str()))
+                               if (!channel->PartUser(dest, reason))
                                        delete channel;
+
                                Channel* n = ServerInstance->FindChan(parameters[1]);
                                if (!n)
                                {