]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_swhois.cpp
Fix potential for duplicate SID if the SID is auto generated.
[user/henk/code/inspircd.git] / src / modules / m_swhois.cpp
index d635654a524fd1229b02031dc35f95f05dc3d677..09d9d94afc2a1a18a769547c69fae81abe83b28f 100644 (file)
@@ -12,9 +12,6 @@
  */
 
 #include "inspircd.h"
-#include "users.h"
-#include "channels.h"
-#include "modules.h"
 
 /* $ModDesc: Provides the SWHOIS command which allows setting of arbitary WHOIS lines */
 
@@ -28,6 +25,7 @@ class cmd_swhois : public command_t
        {
                this->source = "m_swhois.so";
                syntax = "<nick> <swhois>";
+               TRANSLATE3(TR_NICK, TR_TEXT, TR_END);
        }
 
        CmdResult Handle(const char** parameters, int pcnt, userrec* user)
@@ -78,7 +76,21 @@ class cmd_swhois : public command_t
                text = new std::string(line);
                dest->Extend("swhois", text);
 
-               return CMD_SUCCESS;
+               /* Bug #376 - feature request -
+                * To cut down on the amount of commands services etc have to recognise, this only sends METADATA across the network now
+                * not an actual SWHOIS command. Any SWHOIS command sent from services will be automatically translated to METADATA by this.
+                * Sorry w00t i know this was your fix, but i got bored and wanted to clear down the tracker :)
+                * -- Brain
+                */
+               std::deque<std::string>* metadata = new std::deque<std::string>;
+               metadata->push_back(dest->nick);
+               metadata->push_back("swhois");          // The metadata id
+               metadata->push_back(*text);             // The value to send
+               Event event((char*)metadata,(Module*)this,"send_metadata");
+               event.Send(ServerInstance);
+               delete metadata;
+
+               return CMD_LOCALONLY;
        }
 
 };
@@ -260,7 +272,7 @@ class ModuleSWhois : public Module
        
        virtual Version GetVersion()
        {
-               return Version(1,1,0,0,VF_VENDOR,API_VERSION);
+               return Version(1, 1, 0, 0, VF_COMMON | VF_VENDOR, API_VERSION);
        }
 };