]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_sapart.cpp
kick_channel -> chanrec::KickUser(), server_kick_channel -> chanrec::ServerKickUser()
[user/henk/code/inspircd.git] / src / modules / m_sapart.cpp
index 7c3142cdd63dcf9c7a7b4ee74572326126f0809a..f7620ec006cd1e3cf4698d2ac89be7d4097ac4be 100644 (file)
@@ -3,13 +3,13 @@
  *       +------------------------------------+
  *
  *  InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev.
- *                       E-mail:
- *                <brain@chatspike.net>
- *               <Craig@chatspike.net>
+ *                    E-mail:
+ *             <brain@chatspike.net>
+ *               <Craig@chatspike.net>
  *     
  * Written by Craig Edwards, Craig McLure, and others.
  * This program is free but copyrighted software; see
- *            the file COPYING for details.
+ *         the file COPYING for details.
  *
  * ---------------------------------------------------
  */
@@ -25,7 +25,7 @@ using namespace std;
 
 /* $ModDesc: Provides support for unreal-style SAPART command */
 
-Server *Srv;
+static Server *Srv;
 
 class cmd_sapart : public command_t
 {
@@ -33,13 +33,19 @@ class cmd_sapart : public command_t
        cmd_sapart () : command_t("SAPART", 'o', 2)
        {
                this->source = "m_sapart.so";
+               syntax = "<nick> <channel>";
        }
         
-       void Handle (char **parameters, int pcnt, userrec *user)
+       void Handle (const char** parameters, int pcnt, userrec *user)
        {
                userrec* dest = Srv->FindNick(std::string(parameters[0]));
                if (dest)
                {
+                       if (Srv->IsUlined(dest->server))
+                       {
+                               WriteServ(user->fd,"990 %s :Cannot use an SA command on a u-lined client",user->nick);
+                               return;
+                       }
                        if (!IsValidChannelName(parameters[1]))
                        {
                                Srv->SendTo(NULL,user,"NOTICE "+std::string(user->nick)+" :*** Invalid characters in channel name");