summaryrefslogtreecommitdiff
path: root/modules/protocol/hybrid.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2014-02-27 23:21:50 -0500
committerAdam <Adam@anope.org>2014-02-27 23:21:50 -0500
commite2ecec31b5b976fa37639de0f9aa00af747813fa (patch)
tree94558b18671fd6e726193e429cbfbc5d777ed055 /modules/protocol/hybrid.cpp
parentfee016bb84ba9a951000dac581261827a11cb668 (diff)
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
Diffstat (limited to 'modules/protocol/hybrid.cpp')
-rw-r--r--modules/protocol/hybrid.cpp15
1 files changed, 14 insertions, 1 deletions
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