]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_swhois.cpp
Wheee, mass commit! this adds const stafety, throwing a compile error if anyone does...
[user/henk/code/inspircd.git] / src / modules / m_swhois.cpp
index 9ebbb2a083783fbf1a4203b1b262bde0a924c4e1..ef5c5c35f14c9c6bddd1ddacabd774dc1e049118 100644 (file)
@@ -21,14 +21,14 @@ class CommandSwhois : public Command
 {
        
  public:
-       CommandSwhois (InspIRCd* Instance) : Command(Instance,"SWHOIS",'o',2)
+       CommandSwhois (InspIRCd* Instance) : Command(Instance,"SWHOIS","o",2)
        {
                this->source = "m_swhois.so";
                syntax = "<nick> <swhois>";
                TRANSLATE3(TR_NICK, TR_TEXT, TR_END);
        }
 
-       CmdResult Handle(const char** parameters, int pcnt, User* user)
+       CmdResult Handle(const char* const* parameters, int pcnt, User* user)
        {
                User* dest = ServerInstance->FindNick(parameters[0]);
                
@@ -38,12 +38,6 @@ class CommandSwhois : public Command
                        return CMD_FAILURE;
                }
 
-               if (!*parameters[1])
-               {
-                       user->WriteServ("NOTICE %s :*** SWHOIS: Whois line must be specified", user->nick);
-                       return CMD_FAILURE;
-               }
-               
                std::string line;
                for (int i = 1; i < pcnt; i++)
                {
@@ -90,7 +84,7 @@ class CommandSwhois : public Command
                delete metadata;
                
                // If it's an empty swhois, unset it (not ideal, but ok)
-               if (text.empty())
+               if (text->empty())
                {
                        dest->Shrink("swhois");
                        delete text;
@@ -210,13 +204,13 @@ class ModuleSWhois : public Module
                        std::string* text;
                        if (!dest->GetExt("swhois", text))
                        {
-                               std::string* text = new std::string(extdata);
-                               dest->Extend("swhois",text);
+                               std::string* text2 = new std::string(extdata);
+                               dest->Extend("swhois",text2);
                        }
                }
        }
        
-       virtual void OnPostCommand(const std::string &command, const char **params, int pcnt, User *user, CmdResult result, const std::string &original_line)
+       virtual void OnPostCommand(const std::string &command, const char* const* params, int pcnt, User *user, CmdResult result, const std::string &original_line)
        {
                if ((command != "OPER") || (result != CMD_SUCCESS))
                        return;