]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/commands/cmd_rehash.cpp
Snotice on failed oper.
[user/henk/code/inspircd.git] / src / commands / cmd_rehash.cpp
index cf093552cb3d7039ae1bce8df2e5b71ac3c98cd0..ce34239a5562f6907271d76911881e38bc176da7 100644 (file)
@@ -22,23 +22,20 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance)
        return new CommandRehash(Instance);
 }
 
-CmdResult CommandRehash::Handle (const char* const* parameters, int pcnt, User *user)
+CmdResult CommandRehash::Handle (const std::vector<std::string>& parameters, User *user)
 {
        std::string old_disabled = ServerInstance->Config->DisabledCommands;
 
-       ServerInstance->Logs->Log("fuckingrehash", DEBUG, "parc %d p0 %s", pcnt, parameters[0]);
-       if (pcnt && parameters[0][0] != '-')
+       if (parameters.size() && parameters[0][0] != '-')
        {
                if (!ServerInstance->MatchText(ServerInstance->Config->ServerName, parameters[0]))
                {
-                       ServerInstance->Logs->Log("fuckingrehash", DEBUG, "rehash for a server, and not for us");
                        FOREACH_MOD(I_OnRehash,OnRehash(user, parameters[0]));
                        return CMD_SUCCESS; // rehash for a server, and not for us
                }
        }
-       else if (pcnt)
+       else if (parameters.size())
        {
-               ServerInstance->Logs->Log("fuckingrehash", DEBUG, "rehash for a subsystem, ignoring");
                FOREACH_MOD(I_OnRehash,OnRehash(user, parameters[0]));
                return CMD_SUCCESS;
        }
@@ -51,14 +48,12 @@ CmdResult CommandRehash::Handle (const char* const* parameters, int pcnt, User *
 
        std::string m = std::string(user->nick) + " is rehashing config file " + ServerConfig::CleanFilename(ServerInstance->ConfigFileName) + " on " + ServerInstance->Config->ServerName;
        ServerInstance->SNO->WriteToSnoMask('A', m);
-       ServerInstance->PI->SendSNONotice("A", m);
        ServerInstance->Logs->CloseLogs();
 
        if (!ServerInstance->OpenLog(ServerInstance->Config->argv, ServerInstance->Config->argc))
        {
                m = std::string("ERROR: Could not open logfile ") + ServerInstance->Config->logpath + ":" + strerror(errno);
                ServerInstance->SNO->WriteToSnoMask('A', m);
-               ServerInstance->PI->SendSNONotice("A", m);
        }
 
        ServerInstance->RehashUsersAndChans();
@@ -67,7 +62,7 @@ CmdResult CommandRehash::Handle (const char* const* parameters, int pcnt, User *
        if (!ServerInstance->ConfigThread)
        {
                ServerInstance->Config->RehashUser = user;
-               ServerInstance->Config->RehashParameter = pcnt ? parameters[0] : "";
+               ServerInstance->Config->RehashParameter = parameters.size() ? parameters[0] : "";
 
                ServerInstance->ConfigThread = new ConfigReaderThread(ServerInstance, false, user);
                ServerInstance->Threads->Create(ServerInstance->ConfigThread);