diff options
author | Adam <Adam@anope.org> | 2013-05-26 17:13:11 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2013-05-26 17:13:11 -0400 |
commit | 22658d63bdb1e52a66f4514af45fa55ca5891345 (patch) | |
tree | 673304ab19f7e077b489354248247867518331f8 /modules/commands/os_news.cpp | |
parent | f2dee1e1d642b07947f59f91dfba9af34ef84685 (diff) |
Get rid of the remaining references in the core to specific services. Move more stuff out of the core to the proper modules.
Diffstat (limited to 'modules/commands/os_news.cpp')
-rw-r--r-- | modules/commands/os_news.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/modules/commands/os_news.cpp b/modules/commands/os_news.cpp index e9f70b693..1d55df843 100644 --- a/modules/commands/os_news.cpp +++ b/modules/commands/os_news.cpp @@ -9,8 +9,6 @@ * Based on the original code of Services by Andy Church. */ -/*************************************************************************/ - #include "module.h" #include "modules/os_news.h" @@ -342,6 +340,14 @@ class OSNews : public Module if (newsList.empty()) return; + BotInfo *bi = NULL; + if (Type == NEWS_OPER) + bi = BotInfo::Find(Config->GetModule(this)->Get<const Anope::string>("oper_announcer", "OperServ"), true); + else + bi = BotInfo::Find(Config->GetModule(this)->Get<const Anope::string>("announcer", "Global"), true); + if (bi == NULL) + return; + Anope::string msg; if (Type == NEWS_LOGON) msg = _("[\002Logon News\002 - %s] %s"); @@ -357,14 +363,7 @@ class OSNews : public Module if (Type == NEWS_RANDOM && i != cur_rand_news) continue; - const BotInfo *gl = Global; - if (!gl && !BotListByNick->empty()) - gl = BotListByNick->begin()->second; - const BotInfo *os = OperServ; - if (!os) - os = gl; - if (gl) - u->SendMessage(Type != NEWS_OPER ? gl : os, msg.c_str(), Anope::strftime(newsList[i]->time).c_str(), newsList[i]->text.c_str()); + u->SendMessage(bi, msg.c_str(), Anope::strftime(newsList[i]->time).c_str(), newsList[i]->text.c_str()); ++displayed; |