X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_sapart.cpp;h=e3af0f8cd26c40f3943b08cbe692fab80cd1d1a6;hb=495ea4be05859f46cbf99c10541210fa3590f01a;hp=05fe5ffdc0c1d6d1bbc7683172ff9f6ef07e67d8;hpb=d185decae97752368d5cf62311cbc0d1a52aa22c;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_sapart.cpp b/src/modules/m_sapart.cpp index 05fe5ffdc..e3af0f8cd 100644 --- a/src/modules/m_sapart.cpp +++ b/src/modules/m_sapart.cpp @@ -2,8 +2,8 @@ * | Inspire Internet Relay Chat Daemon | * +------------------------------------+ * - * InspIRCd: (C) 2002-2008 InspIRCd Development Team - * See: http://www.inspircd.org/wiki/index.php/Credits + * InspIRCd: (C) 2002-2009 InspIRCd Development Team + * See: http://wiki.inspircd.org/Credits * * This program is free but copyrighted software; see * the file COPYING for details. @@ -20,7 +20,7 @@ class CommandSapart : public Command { public: - CommandSapart (InspIRCd* Instance) : Command(Instance,"SAPART", "o", 2, false, 0) + CommandSapart (InspIRCd* Instance) : Command(Instance,"SAPART", "o", 2, 3, false, 0) { this->source = "m_sapart.so"; syntax = " [reason]"; @@ -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) { @@ -110,7 +109,7 @@ class ModuleSapart : public Module virtual Version GetVersion() { - return Version(1, 2, 0, 1, VF_COMMON | VF_VENDOR, API_VERSION); + return Version("$Id$", VF_COMMON | VF_VENDOR, API_VERSION); } };