From 78ae403e54b48932436bfff766f80a9929625feb Mon Sep 17 00:00:00 2001 From: danieldg Date: Fri, 13 Mar 2009 23:46:56 +0000 Subject: 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 --- src/modules/m_globalload.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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()); -- cgit v1.2.3