]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_userip.cpp
Someone is getting slapped for this; the new hidesplits/hidebans behavior doesn't...
[user/henk/code/inspircd.git] / src / modules / m_userip.cpp
index 48c343fa908984723ba1e90931360119007321aa..86b3cd02ee8ed9951135f6bd06555d7d46734114 100644 (file)
@@ -2,56 +2,52 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev.
- *                       E-mail:
- *                <brain@chatspike.net>
- *               <Craig@chatspike.net>
- *     
- * Written by Craig Edwards, Craig McLure, and others.
+ *  InspIRCd: (C) 2002-2007 InspIRCd Development Team
+ * See: http://www.inspircd.org/wiki/index.php/Credits
+ *
  * This program is free but copyrighted software; see
  *            the file COPYING for details.
  *
  * ---------------------------------------------------
  */
 
-using namespace std;
-
 #include <stdio.h>
 #include <string>
 #include "users.h"
 #include "channels.h"
 #include "modules.h"
-#include "helperfuncs.h"
 #include "inspircd.h"
 
 /* $ModDesc: Provides support for USERIP command */
 
-
-extern InspIRCd* ServerInstance;
-
+/** Handle /USERIP
+ */
 class cmd_userip : public command_t
 {
  public:
- cmd_userip (InspIRCd* Instance) : command_t(Instance,"USERIP", 'o', 1)
      cmd_userip (InspIRCd* Instance) : command_t(Instance,"USERIP", 'o', 1)
        {
                this->source = "m_userip.so";
                syntax = "<nick>{,<nick>}";
        }
 
-       void Handle (const char** parameters, int pcnt, userrec *user)
+       CmdResult Handle (const char** parameters, int pcnt, userrec *user)
        {
                char Return[MAXBUF],junk[MAXBUF];
                snprintf(Return,MAXBUF,"340 %s :",user->nick);
                for (int i = 0; i < pcnt; i++)
                {
                        userrec *u = ServerInstance->FindNick(parameters[i]);
-                       if (u)
+                       if ((u) && (u->registered == REG_ALL))
                        {
                                snprintf(junk,MAXBUF,"%s%s=+%s@%s ",u->nick,*u->oper ? "*" : "",u->ident,u->GetIPString());
                                strlcat(Return,junk,MAXBUF);
                        }
                }
                user->WriteServ(Return);
+
+               /* Dont send to the network */
+               return CMD_FAILURE;
        }
 };
 
@@ -83,7 +79,7 @@ class ModuleUserIP : public Module
        
        virtual Version GetVersion()
        {
-               return Version(1,0,0,1,VF_VENDOR);
+               return Version(1,1,0,1,VF_VENDOR,API_VERSION);
        }
        
 };