From 9c3a20c15123c4812c236f33418c1fdfe74c3ff2 Mon Sep 17 00:00:00 2001 From: w00t Date: Fri, 11 May 2007 18:09:22 +0000 Subject: Last commit of that batch: Fix some returncodes (some stuff here really didn't need to be routed), clarify a few in comments, and also add some todos for myself next. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6978 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_alltime.cpp | 3 ++- src/modules/m_cban.cpp | 1 + src/modules/m_dccallow.cpp | 3 ++- src/modules/m_devoice.cpp | 1 + src/modules/m_globalload.cpp | 5 +++++ src/modules/m_globops.cpp | 1 + src/modules/m_nicklock.cpp | 2 ++ src/modules/m_opermotd.cpp | 6 +++++- src/modules/m_randquote.cpp | 3 ++- src/modules/m_remove.cpp | 1 + src/modules/m_setidle.cpp | 2 +- 11 files changed, 23 insertions(+), 5 deletions(-) (limited to 'src/modules') diff --git a/src/modules/m_alltime.cpp b/src/modules/m_alltime.cpp index 3356974c6..04ae63b17 100644 --- a/src/modules/m_alltime.cpp +++ b/src/modules/m_alltime.cpp @@ -53,7 +53,8 @@ class cmd_alltime : public command_t Event ev((char *) ¶ms, NULL, "send_push"); ev.Send(ServerInstance); } - + + /* we want this routed out! */ return CMD_SUCCESS; } }; diff --git a/src/modules/m_cban.cpp b/src/modules/m_cban.cpp index 5491f5e3a..e6e3b92b0 100644 --- a/src/modules/m_cban.cpp +++ b/src/modules/m_cban.cpp @@ -111,6 +111,7 @@ class cmd_cban : public command_t } } + /* we want this routed! */ return CMD_SUCCESS; } }; diff --git a/src/modules/m_dccallow.cpp b/src/modules/m_dccallow.cpp index d92aeed82..4fd0277a8 100644 --- a/src/modules/m_dccallow.cpp +++ b/src/modules/m_dccallow.cpp @@ -190,7 +190,8 @@ class cmd_dccallow : public command_t { user->WriteServ("994 %s %s :Added %s to DCCALLOW list for this session", user->nick, user->nick, target->nick); } - + + /* route it. */ return CMD_SUCCESS; } } diff --git a/src/modules/m_devoice.cpp b/src/modules/m_devoice.cpp index 8960995e8..7400d2212 100644 --- a/src/modules/m_devoice.cpp +++ b/src/modules/m_devoice.cpp @@ -50,6 +50,7 @@ class cmd_devoice : public command_t ServerInstance->SendMode(modes,3,n); delete n; + /* route it */ return CMD_SUCCESS; } diff --git a/src/modules/m_globalload.cpp b/src/modules/m_globalload.cpp index 2280572d7..ca945b496 100644 --- a/src/modules/m_globalload.cpp +++ b/src/modules/m_globalload.cpp @@ -36,11 +36,14 @@ class cmd_gloadmodule : public command_t { ServerInstance->WriteOpers("*** NEW MODULE '%s' GLOBALLY LOADED BY '%s'",parameters[0],user->nick); user->WriteServ("975 %s %s :Module successfully loaded.",user->nick, parameters[0]); + + /* route it! */ return CMD_SUCCESS; } else { user->WriteServ("974 %s %s :Failed to load module: %s",user->nick, parameters[0],ServerInstance->ModuleError()); + /* XXX - returning CMD_FAILURE here could potentially mean half the net loads it, half doesn't. pass it on anyway? -- w00t */ return CMD_FAILURE; } } @@ -63,10 +66,12 @@ class cmd_gunloadmodule : public command_t { ServerInstance->WriteOpers("*** MODULE '%s' GLOBALLY UNLOADED BY '%s'",parameters[0],user->nick); user->WriteServ("973 %s %s :Module successfully unloaded.",user->nick, parameters[0]); + /* route it! */ return CMD_SUCCESS; } else { + /* XXX - see above note about returning CMD_FAILURE here -- w00t */ user->WriteServ("972 %s %s :Failed to unload module: %s",user->nick, parameters[0],ServerInstance->ModuleError()); return CMD_FAILURE; } diff --git a/src/modules/m_globops.cpp b/src/modules/m_globops.cpp index 3d48eb92a..7e4d88d94 100644 --- a/src/modules/m_globops.cpp +++ b/src/modules/m_globops.cpp @@ -42,6 +42,7 @@ class cmd_globops : public command_t } ServerInstance->SNO->WriteToSnoMask('g',line); + /* route it (ofc :p) */ return CMD_SUCCESS; } }; diff --git a/src/modules/m_nicklock.cpp b/src/modules/m_nicklock.cpp index 509b565ca..519aabe13 100644 --- a/src/modules/m_nicklock.cpp +++ b/src/modules/m_nicklock.cpp @@ -41,6 +41,7 @@ class cmd_nicklock : public command_t irc::string server; irc::string me; + /* XXX - these ifs look damn ugly, note to myself to fix them -- w00t */ if (source) { if (source->GetExt("nick_locked", dummy)) @@ -59,6 +60,7 @@ class cmd_nicklock : public command_t } source->Extend("nick_locked", "ON"); + /* route */ return CMD_SUCCESS; } diff --git a/src/modules/m_opermotd.cpp b/src/modules/m_opermotd.cpp index a80aa513c..447468caf 100644 --- a/src/modules/m_opermotd.cpp +++ b/src/modules/m_opermotd.cpp @@ -29,14 +29,18 @@ CmdResult ShowOperMOTD(userrec* user) user->WriteServ(std::string("425 ") + user->nick + std::string(" :OPERMOTD file is missing")); return CMD_FAILURE; } + user->WriteServ(std::string("375 ") + user->nick + std::string(" :- IRC Operators Message of the Day")); + for(int i=0; i != opermotd->FileSize(); i++) { user->WriteServ(std::string("372 ") + user->nick + std::string(" :- ") + opermotd->GetLine(i)); } + user->WriteServ(std::string("376 ") + user->nick + std::string(" :- End of OPERMOTD")); - return CMD_SUCCESS; + /* don't route me */ + return CMD_LOCALONLY; } /** Handle /OPERMOTD diff --git a/src/modules/m_randquote.cpp b/src/modules/m_randquote.cpp index 034bea040..2eb5539b8 100644 --- a/src/modules/m_randquote.cpp +++ b/src/modules/m_randquote.cpp @@ -52,7 +52,8 @@ class cmd_randquote : public command_t user->WriteServ("NOTICE %s :Your administrator specified an invalid quotes file, please bug them about this.", user->nick); return CMD_FAILURE; } - return CMD_SUCCESS; + + return CMD_LOCALONLY; } }; diff --git a/src/modules/m_remove.cpp b/src/modules/m_remove.cpp index 23fee34c3..e5c433b84 100644 --- a/src/modules/m_remove.cpp +++ b/src/modules/m_remove.cpp @@ -201,6 +201,7 @@ class RemoveBase return CMD_FAILURE; } + /* route me */ return CMD_SUCCESS; } }; diff --git a/src/modules/m_setidle.cpp b/src/modules/m_setidle.cpp index 255a55322..76a1ea3e5 100644 --- a/src/modules/m_setidle.cpp +++ b/src/modules/m_setidle.cpp @@ -45,7 +45,7 @@ class cmd_setidle : public command_t ServerInstance->WriteOpers(std::string(user->nick)+" used SETIDLE to set their idle time to "+ConvToStr(atoi(parameters[0]))+" seconds"); user->WriteServ("944 %s :Idle time set.",user->nick); - return CMD_SUCCESS; + return CMD_LOCALONLY; } }; -- cgit v1.2.3