summaryrefslogtreecommitdiff
path: root/modules/pseudoclients/hostserv.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2013-05-26 17:13:11 -0400
committerAdam <Adam@anope.org>2013-05-26 17:13:11 -0400
commit22658d63bdb1e52a66f4514af45fa55ca5891345 (patch)
tree673304ab19f7e077b489354248247867518331f8 /modules/pseudoclients/hostserv.cpp
parentf2dee1e1d642b07947f59f91dfba9af34ef84685 (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/pseudoclients/hostserv.cpp')
-rw-r--r--modules/pseudoclients/hostserv.cpp22
1 files changed, 5 insertions, 17 deletions
diff --git a/modules/pseudoclients/hostserv.cpp b/modules/pseudoclients/hostserv.cpp
index e3afa37d3..7c98c7344 100644
--- a/modules/pseudoclients/hostserv.cpp
+++ b/modules/pseudoclients/hostserv.cpp
@@ -9,12 +9,11 @@
* Based on the original code of Services by Andy Church.
*/
-/*************************************************************************/
-
#include "module.h"
class HostServCore : public Module
{
+ Reference<BotInfo> HostServ;
public:
HostServCore(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, PSEUDOCLIENT | VENDOR)
{
@@ -22,36 +21,25 @@ class HostServCore : public Module
if (!IRCD || !IRCD->CanSetVHost)
throw ModuleException("Your IRCd does not support vhosts");
- Implementation i[] = { I_OnReload, I_OnBotDelete, I_OnNickIdentify, I_OnNickUpdate, I_OnPreHelp,
+ Implementation i[] = { I_OnReload, I_OnNickIdentify, I_OnNickUpdate, I_OnPreHelp,
I_OnSetVhost, I_OnDeleteVhost };
ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation));
}
- ~HostServCore()
- {
- HostServ = NULL;
- }
-
void OnReload(Configuration::Conf *conf) anope_override
{
const Anope::string &hsnick = conf->GetModule(this)->Get<const Anope::string>("client");
if (hsnick.empty())
- throw ConfigException(this->name + ": <client> must be defined");
+ throw ConfigException(Module::name + ": <client> must be defined");
BotInfo *bi = BotInfo::Find(hsnick, true);
if (!bi)
- throw ConfigException(this->name + ": no bot named " + hsnick);
+ throw ConfigException(Module::name + ": no bot named " + hsnick);
HostServ = bi;
}
- void OnBotDelete(BotInfo *bi) anope_override
- {
- if (bi == HostServ)
- HostServ = NULL;
- }
-
void OnNickIdentify(User *u) anope_override
{
const NickAlias *na = NickAlias::Find(u->nick);
@@ -87,7 +75,7 @@ class HostServCore : public Module
EventReturn OnPreHelp(CommandSource &source, const std::vector<Anope::string> &params) anope_override
{
- if (!params.empty() || source.c || source.service != HostServ)
+ if (!params.empty() || source.c || source.service != *HostServ)
return EVENT_CONTINUE;
source.Reply(_("%s commands:"), HostServ->nick.c_str());
return EVENT_CONTINUE;