diff options
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/m_filter.cpp | 7 | ||||
-rw-r--r-- | src/modules/m_globalload.cpp | 21 | ||||
-rw-r--r-- | src/modules/m_spanningtree/idle.cpp (renamed from src/modules/m_spanningtree/whois.cpp) | 0 | ||||
-rw-r--r-- | src/modules/m_spanningtree/link.h | 1 | ||||
-rw-r--r-- | src/modules/m_watch.cpp | 2 |
5 files changed, 26 insertions, 5 deletions
diff --git a/src/modules/m_filter.cpp b/src/modules/m_filter.cpp index 69117ae55..e4b2645f9 100644 --- a/src/modules/m_filter.cpp +++ b/src/modules/m_filter.cpp @@ -165,7 +165,8 @@ CmdResult CommandFilter::Handle(const std::vector<std::string> ¶meters, User if (parameters.size() == 1) { /* Deleting a filter */ - if (static_cast<ModuleFilter&>(*creator).DeleteFilter(parameters[0])) + Module *me = creator; + if (static_cast<ModuleFilter *>(me)->DeleteFilter(parameters[0])) { user->WriteServ("NOTICE %s :*** Removed filter '%s'", user->nick.c_str(), parameters[0].c_str()); ServerInstance->SNO->WriteToSnoMask(IS_LOCAL(user) ? 'a' : 'A', std::string("FILTER: ")+user->nick+" removed filter '"+parameters[0]+"'"); @@ -212,7 +213,9 @@ CmdResult CommandFilter::Handle(const std::vector<std::string> ¶meters, User { reason = parameters[3]; } - std::pair<bool, std::string> result = static_cast<ModuleFilter&>(*creator).AddFilter(freeform, type, reason, duration, flags); + + Module *me = creator; + std::pair<bool, std::string> result = static_cast<ModuleFilter *>(me)->AddFilter(freeform, type, reason, duration, flags); if (result.first) { user->WriteServ("NOTICE %s :*** Added filter '%s', type '%s'%s%s, flags '%s', reason: '%s'", user->nick.c_str(), freeform.c_str(), diff --git a/src/modules/m_globalload.cpp b/src/modules/m_globalload.cpp index be29b00a5..c9a4231dd 100644 --- a/src/modules/m_globalload.cpp +++ b/src/modules/m_globalload.cpp @@ -96,6 +96,25 @@ class CommandGunloadmodule : public Command } }; +class GReloadModuleWorker : public HandlerBase1<void, bool> +{ + public: + const std::string nick; + const std::string name; + const std::string uid; + GReloadModuleWorker(const std::string& usernick, const std::string& uuid, const std::string& modn) + : nick(usernick), name(modn), uid(uuid) {} + void Call(bool result) + { + ServerInstance->SNO->WriteToSnoMask('a', "MODULE '%s' GLOBALLY RELOADED BY '%s'%s", name.c_str(), nick.c_str(), result ? "" : " (failed here)"); + User* user = ServerInstance->FindNick(uid); + if (user) + user->WriteNumeric(975, "%s %s :Module %ssuccessfully reloaded.", + user->nick.c_str(), name.c_str(), result ? "" : "un"); + ServerInstance->GlobalCulls.AddItem(this); + } +}; + /** Handle /GRELOADMODULE */ class CommandGreloadmodule : public Command @@ -114,7 +133,7 @@ class CommandGreloadmodule : public Command { Module* m = ServerInstance->Modules->Find(parameters[0]); if (m) - ServerInstance->Modules->Reload(m, NULL); + ServerInstance->Modules->Reload(m, new GReloadModuleWorker(user->nick, user->uuid, parameters[0])); else { user->WriteNumeric(975, "%s %s :Could not find module by that name", user->nick.c_str(), parameters[0].c_str()); diff --git a/src/modules/m_spanningtree/whois.cpp b/src/modules/m_spanningtree/idle.cpp index 59dc83985..59dc83985 100644 --- a/src/modules/m_spanningtree/whois.cpp +++ b/src/modules/m_spanningtree/idle.cpp diff --git a/src/modules/m_spanningtree/link.h b/src/modules/m_spanningtree/link.h index 0ff2593cc..c60cb0bb7 100644 --- a/src/modules/m_spanningtree/link.h +++ b/src/modules/m_spanningtree/link.h @@ -45,5 +45,4 @@ class Autoconnect : public refcountbase Autoconnect(ConfigTag* Tag) : tag(Tag) {} }; - #endif diff --git a/src/modules/m_watch.cpp b/src/modules/m_watch.cpp index 78da2799b..9a9e12bb1 100644 --- a/src/modules/m_watch.cpp +++ b/src/modules/m_watch.cpp @@ -90,7 +90,7 @@ #if defined(WINDOWS) && !defined(HASHMAP_DEPRECATED) typedef nspace::hash_map<irc::string, std::deque<User*>, nspace::hash_compare<irc::string, std::less<irc::string> > > watchentries; #else - typedef nspace::hash_map<irc::string, std::deque<User*>, nspace::hash<irc::string> > watchentries; + typedef nspace::hash_map<irc::string, std::deque<User*>, irc::hash> watchentries; #endif typedef std::map<irc::string, std::string> watchlist; |