diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/protocol/charybdis.cpp | 32 | ||||
-rw-r--r-- | modules/protocol/ratbox.cpp | 33 |
2 files changed, 33 insertions, 32 deletions
diff --git a/modules/protocol/charybdis.cpp b/modules/protocol/charybdis.cpp index 68bbe12b8..acfc93044 100644 --- a/modules/protocol/charybdis.cpp +++ b/modules/protocol/charybdis.cpp @@ -31,20 +31,6 @@ class ChannelModeLargeBan : public ChannelMode class CharybdisProto : public IRCDProto { - BotInfo *FindIntroduced() - { - BotInfo *bi = Config->GetClient("OperServ"); - - if (bi && bi->introduced) - return bi; - - for (botinfo_map::iterator it = BotListByNick->begin(), it_end = BotListByNick->end(); it != it_end; ++it) - if (it->second->introduced) - return it->second; - - return NULL; - } - public: CharybdisProto(Module *creator) : IRCDProto(creator, "Charybdis 3.4+") @@ -70,6 +56,8 @@ class CharybdisProto : public IRCDProto void SendSGLineDel(const XLine *x) anope_override { ratbox->SendSGLineDel(x); } void SendAkill(User *u, XLine *x) anope_override { ratbox->SendAkill(u, x); } void SendAkillDel(const XLine *x) anope_override { ratbox->SendAkillDel(x); } + void SendSQLine(User *u, const XLine *x) anope_override { ratbox->SendSQLine(u, x); } + void SendSQLineDel(const XLine *x) anope_override { ratbox->SendSQLineDel(x); } void SendJoin(User *user, Channel *c, const ChannelStatus *status) anope_override { ratbox->SendJoin(user, c, status); } void SendServer(const Server *server) anope_override { ratbox->SendServer(server); } void SendChannel(Channel *c) anope_override { ratbox->SendChannel(c); } @@ -90,22 +78,6 @@ class CharybdisProto : public IRCDProto UplinkSocket::Message(Me) << "ENCAP * MECHLIST :" << (mechanisms.empty() ? "" : mechlist.substr(1)); } - void SendSQLine(User *, const XLine *x) anope_override - { - /* Calculate the time left before this would expire, capping it at 2 days */ - time_t timeleft = x->expires - Anope::CurTime; - - if (timeleft > 172800 || !x->expires) - timeleft = 172800; - - UplinkSocket::Message(FindIntroduced()) << "ENCAP * RESV " << timeleft << " " << x->mask << " 0 :" << x->GetReason(); - } - - void SendSQLineDel(const XLine *x) anope_override - { - UplinkSocket::Message(Config->GetClient("OperServ")) << "ENCAP * UNRESV " << x->mask; - } - void SendConnect() anope_override { UplinkSocket::Message() << "PASS " << Config->Uplinks[Anope::CurrentUplink].password << " TS 6 :" << Me->GetSID(); diff --git a/modules/protocol/ratbox.cpp b/modules/protocol/ratbox.cpp index d89bff602..82aaa6b2d 100644 --- a/modules/protocol/ratbox.cpp +++ b/modules/protocol/ratbox.cpp @@ -17,12 +17,27 @@ static ServiceReference<IRCDProto> hybrid("IRCDProto", "hybrid"); class RatboxProto : public IRCDProto { + BotInfo *FindIntroduced() + { + BotInfo *bi = Config->GetClient("OperServ"); + + if (bi && bi->introduced) + return bi; + + for (botinfo_map::iterator it = BotListByNick->begin(), it_end = BotListByNick->end(); it != it_end; ++it) + if (it->second->introduced) + return it->second; + + return NULL; + } + public: RatboxProto(Module *creator) : IRCDProto(creator, "Ratbox 3.0+") { DefaultPseudoclientModes = "+oiS"; CanSNLine = true; CanSQLine = true; + CanSQLineChannel = true; CanSZLine = true; RequiresID = true; MaxModes = 4; @@ -31,12 +46,10 @@ class RatboxProto : public IRCDProto void SendSVSKillInternal(const MessageSource &source, User *targ, const Anope::string &reason) anope_override { hybrid->SendSVSKillInternal(source, targ, reason); } void SendGlobalNotice(BotInfo *bi, const Server *dest, const Anope::string &msg) anope_override { hybrid->SendGlobalNotice(bi, dest, msg); } void SendGlobalPrivmsg(BotInfo *bi, const Server *dest, const Anope::string &msg) anope_override { hybrid->SendGlobalPrivmsg(bi, dest, msg); } - void SendSQLine(User *u, const XLine *x) anope_override { hybrid->SendSQLine(u, x); } void SendSGLine(User *u, const XLine *x) anope_override { hybrid->SendSGLine(u, x); } void SendSGLineDel(const XLine *x) anope_override { hybrid->SendSGLineDel(x); } void SendAkill(User *u, XLine *x) anope_override { hybrid->SendAkill(u, x); } void SendAkillDel(const XLine *x) anope_override { hybrid->SendAkillDel(x); } - void SendSQLineDel(const XLine *x) anope_override { hybrid->SendSQLineDel(x); } void SendJoin(User *user, Channel *c, const ChannelStatus *status) anope_override { hybrid->SendJoin(user, c, status); } void SendServer(const Server *server) anope_override { hybrid->SendServer(server); } void SendModeInternal(const MessageSource &source, User *u, const Anope::string &buf) anope_override { hybrid->SendModeInternal(source, u, buf); } @@ -48,6 +61,22 @@ class RatboxProto : public IRCDProto UplinkSocket::Message(source) << "OPERWALL :" << buf; } + void SendSQLine(User *, const XLine *x) anope_override + { + /* Calculate the time left before this would expire, capping it at 2 days */ + time_t timeleft = x->expires - Anope::CurTime; + + if (timeleft > 172800 || !x->expires) + timeleft = 172800; + + UplinkSocket::Message(FindIntroduced()) << "ENCAP * RESV " << timeleft << " " << x->mask << " 0 :" << x->GetReason(); + } + + void SendSQLineDel(const XLine *x) anope_override + { + UplinkSocket::Message(Config->GetClient("OperServ")) << "ENCAP * UNRESV " << x->mask; + } + void SendConnect() anope_override { UplinkSocket::Message() << "PASS " << Config->Uplinks[Anope::CurrentUplink].password << " TS 6 :" << Me->GetSID(); |