]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_vhost.cpp
Add the override keyword in places that it is missing.
[user/henk/code/inspircd.git] / src / modules / m_vhost.cpp
index aac15f58aea63b366066fff7887e447fa94862f8..bc10fb819b6de97113e01d8c1b51e583d21c1f42 100644 (file)
@@ -22,8 +22,6 @@
 
 #include "inspircd.h"
 
-/* $ModDesc: Provides masking of user hostnames via traditional /VHOST command */
-
 /** Handle /VHOST
  */
 class CommandVhost : public Command
@@ -34,7 +32,7 @@ class CommandVhost : public Command
                syntax = "<username> <password>";
        }
 
-       CmdResult Handle (const std::vector<std::string> &parameters, User *user)
+       CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE
        {
                ConfigTagList tags = ServerInstance->Config->ConfTags("vhost");
                for(ConfigIter i = tags.first; i != tags.second; ++i)
@@ -45,44 +43,35 @@ class CommandVhost : public Command
                        std::string pass = tag->getString("pass");
                        std::string hash = tag->getString("hash");
 
-                       if (parameters[0] == username && !ServerInstance->PassCompare(user, pass, parameters[1], hash))
+                       if (parameters[0] == username && ServerInstance->PassCompare(user, pass, parameters[1], hash))
                        {
                                if (!mask.empty())
                                {
-                                       user->WriteServ("NOTICE "+user->nick+" :Setting your VHost: " + mask);
-                                       user->ChangeDisplayedHost(mask.c_str());
+                                       user->WriteNotice("Setting your VHost: " + mask);
+                                       user->ChangeDisplayedHost(mask);
                                        return CMD_SUCCESS;
                                }
                        }
                }
 
-               user->WriteServ("NOTICE "+std::string(user->nick)+" :Invalid username or password.");
+               user->WriteNotice("Invalid username or password.");
                return CMD_FAILURE;
        }
 };
 
 class ModuleVHost : public Module
 {
- private:
        CommandVhost cmd;
 
  public:
        ModuleVHost() : cmd(this)
        {
-               ServerInstance->AddCommand(&cmd);
        }
 
-       virtual ~ModuleVHost()
-       {
-       }
-
-
-       virtual Version GetVersion()
+       Version GetVersion() CXX11_OVERRIDE
        {
                return Version("Provides masking of user hostnames via traditional /VHOST command",VF_VENDOR);
        }
-
 };
 
 MODULE_INIT(ModuleVHost)
-