diff options
author | Adam <Adam@anope.org> | 2014-05-28 12:07:29 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2014-05-28 12:07:54 -0400 |
commit | f29e1cf383529a1a29f02b0669d973f5ee0b7a66 (patch) | |
tree | 3c33db276dc9328235bbd572641521ed44458176 /src/bots.cpp | |
parent | 1253c70e0682fa1490c99c3d2869049a0e3fa2e0 (diff) |
Move most of the core pseudoclient logic to modules
Diffstat (limited to 'src/bots.cpp')
-rw-r--r-- | src/bots.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/bots.cpp b/src/bots.cpp index b2feb9c4e..ea0bf4ec3 100644 --- a/src/bots.cpp +++ b/src/bots.cpp @@ -13,16 +13,16 @@ #include "servers.h" #include "protocol.h" #include "xline.h" -#include "regchannel.h" #include "channels.h" #include "config.h" #include "language.h" #include "serialize.h" #include "event.h" +#include "modules/chanserv.h" Serialize::Checker<botinfo_map> BotListByNick("BotInfo"), BotListByUID("BotInfo"); -BotInfo::BotInfo(const Anope::string &nnick, const Anope::string &nuser, const Anope::string &nhost, const Anope::string &nreal, const Anope::string &bmodes) : User(nnick, nuser, nhost, "", "", Me, nreal, Anope::CurTime, "", Servers::TS6_UID_Retrieve(), NULL), Serializable("BotInfo"), channels("ChannelInfo"), botmodes(bmodes) +BotInfo::BotInfo(const Anope::string &nnick, const Anope::string &nuser, const Anope::string &nhost, const Anope::string &nreal, const Anope::string &bmodes) : User(nnick, nuser, nhost, "", "", Me, nreal, Anope::CurTime, "", Servers::TS6_UID_Retrieve(), NULL), Serializable("BotInfo"), channels("ChanServ::Channel"), botmodes(bmodes) { this->lastmsg = this->created = Anope::CurTime; this->introduced = false; @@ -31,7 +31,7 @@ BotInfo::BotInfo(const Anope::string &nnick, const Anope::string &nuser, const A (*BotListByNick)[this->nick] = this; if (!this->uid.empty()) (*BotListByUID)[this->uid] = this; - + Event::OnCreateBot(&Event::CreateBot::OnCreateBot, this); // If we're synchronised with the uplink already, send the bot. @@ -61,9 +61,9 @@ BotInfo::~BotInfo() IRCD->SendSQLineDel(&x); } - for (std::set<ChannelInfo *>::iterator it = this->channels->begin(), it_end = this->channels->end(); it != it_end; ++it) + for (std::set<ChanServ::Channel *>::iterator it = this->channels->begin(), it_end = this->channels->end(); it != it_end; ++it) { - ChannelInfo *ci = *it; + ChanServ::Channel *ci = *it; this->UnAssign(NULL, ci); } @@ -145,12 +145,12 @@ void BotInfo::SetNewNick(const Anope::string &newnick) (*BotListByNick)[this->nick] = this; } -const std::set<ChannelInfo *> &BotInfo::GetChannels() const +const std::set<ChanServ::Channel *> &BotInfo::GetChannels() const { return this->channels; } -void BotInfo::Assign(User *u, ChannelInfo *ci) +void BotInfo::Assign(User *u, ChanServ::Channel *ci) { EventReturn MOD_RESULT; MOD_RESULT = Event::OnPreBotAssign(&Event::PreBotAssign::OnPreBotAssign, u, ci, this); @@ -159,14 +159,14 @@ void BotInfo::Assign(User *u, ChannelInfo *ci) if (ci->bi) ci->bi->UnAssign(u, ci); - + ci->bi = this; this->channels->insert(ci); Event::OnBotAssign(&Event::BotAssign::OnBotAssign, u, ci, this); } -void BotInfo::UnAssign(User *u, ChannelInfo *ci) +void BotInfo::UnAssign(User *u, ChanServ::Channel *ci) { EventReturn MOD_RESULT; MOD_RESULT = Event::OnBotUnAssign(&Event::BotUnAssign::OnBotUnAssign, u, ci); |