summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorattilamolnar <attilamolnar@hush.com>2012-11-16 23:13:12 +0100
committerattilamolnar <attilamolnar@hush.com>2012-11-19 18:32:40 +0100
commit2de13e15c26edf4f4a5c0280974b2dea052c1853 (patch)
tree4944443e242394784051a849d89dcef593afc3e0 /src
parent5c20fd57ec1913dc787b7c620bb4032851dd0d64 (diff)
m_globalload Fix wrong error message being sent when the module given to /gunloadmodule is not found
Diffstat (limited to 'src')
-rw-r--r--src/modules/m_globalload.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/modules/m_globalload.cpp b/src/modules/m_globalload.cpp
index 9a0074cb4..f10d7f465 100644
--- a/src/modules/m_globalload.cpp
+++ b/src/modules/m_globalload.cpp
@@ -84,16 +84,21 @@ class CommandGunloadmodule : public Command
if (InspIRCd::Match(ServerInstance->Config->ServerName.c_str(), servername))
{
Module* m = ServerInstance->Modules->Find(parameters[0]);
- if (m && ServerInstance->Modules->Unload(m))
+ if (m)
{
- ServerInstance->SNO->WriteToSnoMask('a', "MODULE '%s' GLOBALLY UNLOADED BY '%s'",parameters[0].c_str(), user->nick.c_str());
- user->SendText(":%s 973 %s %s :Module successfully unloaded.",
- ServerInstance->Config->ServerName.c_str(), user->nick.c_str(), parameters[0].c_str());
+ if (ServerInstance->Modules->Unload(m))
+ {
+ ServerInstance->SNO->WriteToSnoMask('a', "MODULE '%s' GLOBALLY UNLOADED BY '%s'",parameters[0].c_str(), user->nick.c_str());
+ user->SendText(":%s 973 %s %s :Module successfully unloaded.",
+ ServerInstance->Config->ServerName.c_str(), user->nick.c_str(), parameters[0].c_str());
+ }
+ else
+ {
+ user->WriteNumeric(972, "%s %s :%s",user->nick.c_str(), parameters[0].c_str(), ServerInstance->Modules->LastError().c_str());
+ }
}
else
- {
- user->WriteNumeric(972, "%s %s :%s",user->nick.c_str(), parameters[0].c_str(), ServerInstance->Modules->LastError().c_str());
- }
+ user->SendText(":%s 972 %s %s :No such module", ServerInstance->Config->ServerName.c_str(), user->nick.c_str(), parameters[0].c_str());
}
else
ServerInstance->SNO->WriteToSnoMask('a', "MODULE '%s' GLOBAL UNLOAD BY '%s' (not unloaded here)",parameters[0].c_str(), user->nick.c_str());