diff options
author | Adam <Adam@anope.org> | 2011-04-22 03:16:11 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2011-05-16 04:06:17 -0400 |
commit | c8c23158a4ff74822d6c7d201dc53d879e3d91e8 (patch) | |
tree | 4bc9ae029691d5e7c03ebc1481683a010b733844 /modules/protocol/ratbox.cpp | |
parent | 1782ce260c5bc214ec0b2e39257ab1371b68ae9c (diff) |
Moved the core pseudo clients out into their own modules
Diffstat (limited to 'modules/protocol/ratbox.cpp')
-rw-r--r-- | modules/protocol/ratbox.cpp | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/modules/protocol/ratbox.cpp b/modules/protocol/ratbox.cpp index 62a8d5a72..11d4ccfe6 100644 --- a/modules/protocol/ratbox.cpp +++ b/modules/protocol/ratbox.cpp @@ -11,6 +11,7 @@ #include "services.h" #include "modules.h" +#include "nickserv.h" static Anope::string TS6UPLINK; @@ -103,19 +104,19 @@ class RatboxProto : public IRCDProto void SendSGLineDel(const XLine *x) { - BotInfo *bi = OperServ; + BotInfo *bi = findbot(Config->s_OperServ); send_cmd(bi ? bi->GetUID() : Config->s_OperServ, "UNXLINE * %s", x->Mask.c_str()); } void SendSGLine(User *, const XLine *x) { - BotInfo *bi = OperServ; + BotInfo *bi = findbot(Config->s_OperServ); send_cmd(bi ? bi->GetUID() : Config->s_OperServ, "XLINE * %s 0 :%s", x->Mask.c_str(), x->Reason.c_str()); } void SendAkillDel(const XLine *x) { - BotInfo *bi = OperServ; + BotInfo *bi = findbot(Config->s_OperServ); send_cmd(bi ? bi->GetUID() : Config->s_OperServ, "UNKLINE * %s %s", x->GetUser().c_str(), x->GetHost().c_str()); } @@ -142,7 +143,7 @@ class RatboxProto : public IRCDProto void SendAkill(User *, const XLine *x) { - BotInfo *bi = OperServ; + BotInfo *bi = findbot(Config->s_OperServ); send_cmd(bi ? bi->GetUID() : Config->s_OperServ, "KLINE * %ld %s %s :%s", static_cast<long>(x->Expires - Anope::CurTime), x->GetUser().c_str(), x->GetHost().c_str(), x->Reason.c_str()); } @@ -269,8 +270,8 @@ class RatboxIRCdMessage : public IRCdMessage { /* Source is always the server */ User *user = do_nick("", params[0], params[4], params[5], source, params[8], Anope::string(params[2]).is_pos_number_only() ? convertTo<time_t>(params[2]) : 0, params[6], "*", params[7], params[3]); - if (user && user->server->IsSynced()) - validate_user(user); + if (user && user->server->IsSynced() && nickserv) + nickserv->Validate(user); return true; } @@ -579,12 +580,13 @@ class ProtoRatbox : public Module void OnServerSync(Server *s) { - for (Anope::insensitive_map<User *>::iterator it = UserListByNick.begin(); it != UserListByNick.end(); ++it) - { - User *u = it->second; - if (u->server == s && !u->IsIdentified()) - validate_user(u); - } + if (nickserv) + for (Anope::insensitive_map<User *>::iterator it = UserListByNick.begin(); it != UserListByNick.end(); ++it) + { + User *u = it->second; + if (u->server == s && !u->IsIdentified()) + nickserv->Validate(u); + } } }; |