From e47aacad0ec416069be66b23d5ae8935e708a1bb Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Wed, 5 Nov 2014 00:10:01 +0100 Subject: [PATCH] InspIRCd 2.0: Re-set server-side mlock when an incoming METADATA mlock from a bursting server changes it --- modules/protocol/inspircd20.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/modules/protocol/inspircd20.cpp b/modules/protocol/inspircd20.cpp index 6f52c6006..5b0c6e847 100644 --- a/modules/protocol/inspircd20.cpp +++ b/modules/protocol/inspircd20.cpp @@ -858,6 +858,26 @@ class IRCDMessageMetadata : IRCDMessage void Run(MessageSource &source, const std::vector ¶ms) anope_override { + // We deliberately ignore non-bursting servers to avoid pseudoserver fights + if ((params[0][0] == '#') && (!source.GetServer()->IsSynced())) + { + Channel *c = Channel::Find(params[0]); + if (c && c->ci) + { + if ((do_mlock) && (params[1] == "mlock")) + { + ModeLocks *modelocks = c->ci->GetExt("modelocks"); + Anope::string modes; + if (modelocks) + modes = modelocks->GetMLockAsString(false).replace_all_cs("+", "").replace_all_cs("-", ""); + + // Mode lock string is not what we say it is? + if (modes != params[2]) + UplinkSocket::Message(Me) << "METADATA " << c->name << " mlock :" << modes; + } + } + } + if (insp12_metadata) insp12_metadata->Run(source, params); }