diff options
author | Attila Molnar <attilamolnar@hush.com> | 2014-11-05 00:10:01 +0100 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2015-03-11 23:46:00 +0100 |
commit | e47aacad0ec416069be66b23d5ae8935e708a1bb (patch) | |
tree | a3ab0da978fc40bc2d3e09e67d3c01a7029d2f02 | |
parent | 72ade225a7ec3bc80250cb7ec0454e73c10a1f5a (diff) |
InspIRCd 2.0: Re-set server-side mlock when an incoming METADATA mlock from a bursting server changes it
-rw-r--r-- | modules/protocol/inspircd20.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
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<Anope::string> ¶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>("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); } |