1
0
mirror of https://github.com/anope/anope.git synced 2026-07-02 22:03:13 +02:00

Merge pull request #178 from Techman-/2.0+resv

Thanks
This commit is contained in:
Adam
2016-09-25 14:36:46 -04:00
committed by GitHub
2 changed files with 33 additions and 32 deletions
+2 -30
View File
@@ -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();
+31 -2
View File
@@ -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();