diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-03-13 23:46:56 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-03-13 23:46:56 +0000 |
commit | 78ae403e54b48932436bfff766f80a9929625feb (patch) | |
tree | a92baddf2e07a81eff17bdf6879209a099c2d245 | |
parent | c0487eae4c730f2b607b397fcb0bb7a6db7d7f4f (diff) |
Fix bug #775, GRELOADMODULE displays success message on failure. Reported by Taros
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11214 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r-- | src/modules/m_globalload.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/modules/m_globalload.cpp b/src/modules/m_globalload.cpp index 470ac1098..8aee8654f 100644 --- a/src/modules/m_globalload.cpp +++ b/src/modules/m_globalload.cpp @@ -101,16 +101,20 @@ class CommandGreloadmodule : public Command if (InspIRCd::Match(ServerInstance->Config->ServerName, servername)) { + bool ok = true; if (!ServerInstance->Modules->Unload(parameters[0].c_str())) { + ok = false; user->WriteNumeric(972, "%s %s :%s",user->nick.c_str(), parameters[0].c_str(), ServerInstance->Modules->LastError().c_str()); } if (!ServerInstance->Modules->Load(parameters[0].c_str())) { + ok = false; user->WriteNumeric(974, "%s %s :%s",user->nick.c_str(), parameters[0].c_str(), ServerInstance->Modules->LastError().c_str()); } ServerInstance->SNO->WriteToSnoMask('A', "MODULE '%s' GLOBALLY RELOADED BY '%s'",parameters[0].c_str(), user->nick.c_str()); - user->WriteNumeric(975, "%s %s :Module successfully loaded.",user->nick.c_str(), parameters[0].c_str()); + if (ok) + user->WriteNumeric(975, "%s %s :Module successfully loaded.",user->nick.c_str(), parameters[0].c_str()); } else ServerInstance->SNO->WriteToSnoMask('A', "MODULE '%s' GLOBAL RELOAD BY '%s' (not reloaded here)",parameters[0].c_str(), user->nick.c_str()); |