From e2ecec31b5b976fa37639de0f9aa00af747813fa Mon Sep 17 00:00:00 2001 From: Adam Date: Thu, 27 Feb 2014 23:21:50 -0500 Subject: [PATCH] Hybrid does not let us add resvs as a server, but the core expects to be able to qline bot nicks before introducing the bots as a way to prevent collisions, so try harder to find a valid bot to send resvs on startup --- modules/protocol/hybrid.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/modules/protocol/hybrid.cpp b/modules/protocol/hybrid.cpp index f2528e304..0fa4287e6 100644 --- a/modules/protocol/hybrid.cpp +++ b/modules/protocol/hybrid.cpp @@ -16,6 +16,19 @@ static Anope::string UplinkSID; class HybridProto : 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; + } + void SendSVSKillInternal(const MessageSource &source, User *user, const Anope::string &buf) anope_override { IRCDProto::SendSVSKillInternal(source, user, buf); @@ -54,7 +67,7 @@ class HybridProto : public IRCDProto void SendSQLine(User *, const XLine *x) anope_override { - UplinkSocket::Message(Config->GetClient("OperServ")) << "ENCAP * RESV " << (x->expires ? x->expires - Anope::CurTime : 0) << " " << x->mask << " 0 :" << x->reason; + UplinkSocket::Message(FindIntroduced()) << "ENCAP * RESV " << (x->expires ? x->expires - Anope::CurTime : 0) << " " << x->mask << " 0 :" << x->reason; } void SendSGLineDel(const XLine *x) anope_override