]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_chghost.cpp
Move OnSync{Channel,Network,User} to ServerEventListener.
[user/henk/code/inspircd.git] / src / modules / m_chghost.cpp
index 60146c78b1258e5eda99f3015593baa2cec9dc8b..30efd1390ffc74820aa18d5fb660e5c00f4860de 100644 (file)
@@ -35,17 +35,15 @@ class CommandChghost : public Command
                TRANSLATE2(TR_NICK, TR_TEXT);
        }
 
-       CmdResult Handle(const std::vector<std::string> &parameters, User *user)
+       CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE
        {
-               const char* x = parameters[1].c_str();
-
                if (parameters[1].length() > ServerInstance->Config->Limits.MaxHost)
                {
                        user->WriteNotice("*** CHGHOST: Host too long");
                        return CMD_FAILURE;
                }
 
-               for (; *x; x++)
+               for (std::string::const_iterator x = parameters[1].begin(); x != parameters[1].end(); x++)
                {
                        if (!hostmap[(unsigned char)*x])
                        {
@@ -68,14 +66,14 @@ class CommandChghost : public Command
                        if ((dest->ChangeDisplayedHost(parameters[1])) && (!user->server->IsULine()))
                        {
                                // fix by brain - ulines set hosts silently
-                               ServerInstance->SNO->WriteGlobalSno('a', user->nick+" used CHGHOST to make the displayed host of "+dest->nick+" become "+dest->dhost);
+                               ServerInstance->SNO->WriteGlobalSno('a', user->nick+" used CHGHOST to make the displayed host of "+dest->nick+" become "+dest->GetDisplayedHost());
                        }
                }
 
                return CMD_SUCCESS;
        }
 
-       RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters)
+       RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) CXX11_OVERRIDE
        {
                return ROUTE_OPT_UCAST(parameters[0]);
        }