]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/commands/cmd_rehash.cpp
Fix extra End of /STATS on spanningtree override of stats c and n.
[user/henk/code/inspircd.git] / src / commands / cmd_rehash.cpp
index 6a7ed124ba15fa49dea5802333928d0af762f00a..9a9384af522fb2f3c12aac164c098f2017a2c9bf 100644 (file)
@@ -28,7 +28,7 @@ CmdResult CommandRehash::Handle (const std::vector<std::string>& parameters, Use
 
        if (parameters.size() && parameters[0][0] != '-')
        {
-               if (!ServerInstance->MatchText(ServerInstance->Config->ServerName, parameters[0]))
+               if (!InspIRCd::Match(ServerInstance->Config->ServerName, parameters[0]))
                {
                        FOREACH_MOD(I_OnRehash,OnRehash(user, parameters[0]));
                        return CMD_SUCCESS; // rehash for a server, and not for us
@@ -43,8 +43,11 @@ CmdResult CommandRehash::Handle (const std::vector<std::string>& parameters, Use
        // Rehash for me.
        FOREACH_MOD(I_OnRehash,OnRehash(user, ""));
 
-       // XXX write this to a remote user correctly
-       user->WriteNumeric(382, "%s %s :Rehashing",user->nick.c_str(),ServerConfig::CleanFilename(ServerInstance->ConfigFileName));
+       if (IS_LOCAL(user))
+               user->WriteNumeric(RPL_REHASHING, "%s %s :Rehashing",user->nick.c_str(),ServerConfig::CleanFilename(ServerInstance->ConfigFileName));
+       else
+               ServerInstance->PI->SendUserNotice(user, std::string("*** Rehashing server ") + ServerInstance->ConfigFileName);
+
 
        std::string m = user->nick + " is rehashing config file " + ServerConfig::CleanFilename(ServerInstance->ConfigFileName) + " on " + ServerInstance->Config->ServerName;
        ServerInstance->SNO->WriteToSnoMask('A', m);
@@ -69,7 +72,10 @@ CmdResult CommandRehash::Handle (const std::vector<std::string>& parameters, Use
        }
        else
        {
-               /* A rehash is already in progress! ahh shit. */
+               /*
+                * A rehash is already in progress! ahh shit.
+                * XXX, todo: we should find some way to kill runaway rehashes that are blocking, this is a major problem for unrealircd users
+                */
                if (IS_LOCAL(user))
                        user->WriteServ("NOTICE %s :*** Could not rehash: A rehash is already in progress.", user->nick.c_str());
                else