diff options
author | Peter Powell <petpow@saberuk.com> | 2018-02-24 11:50:54 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-24 11:50:54 +0000 |
commit | 52e8d8b72e6a7e20f94dbe4fb637f437b4ab98ec (patch) | |
tree | f86aee68f4d39d4b579489673aac3cc833ffebee /src/modules | |
parent | fc4a935e25fa4e20695da389be70b55f619fe9b0 (diff) | |
parent | 219e01b5ce7588efc5da9b8c5d1ce8e7a629b462 (diff) |
Merge pull request #1458 from linuxdaemon/insp20+duplicate-redir-meta
[2.0] Make sure banredirect metadata can not be duplicated
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/m_banredirect.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/modules/m_banredirect.cpp b/src/modules/m_banredirect.cpp index 1b9e361bf..1d35c2934 100644 --- a/src/modules/m_banredirect.cpp +++ b/src/modules/m_banredirect.cpp @@ -178,6 +178,21 @@ class BanRedirect : public ModeWatcher redirects = new BanRedirectList; extItem.set(channel, redirects); } + else + { + for (BanRedirectList::iterator redir = redirects->begin(); redir != redirects->end(); ++redir) + { + // Mimic the functionality used when removing the mode + if ((irc::string(redir->targetchan.c_str()) == irc::string(mask[CHAN].c_str())) && (irc::string(redir->banmask.c_str()) == irc::string(param.c_str()))) + { + // Make sure the +b handler will still set the right ban + param.append(mask[CHAN]); + // Silently ignore the duplicate and don't set metadata + // This still allows channel ops to set/unset a redirect ban to clear "ghost" redirects + return true; + } + } + } /* Here 'param' doesn't have the channel on it yet */ redirects->push_back(BanRedirectEntry(mask[CHAN], param)); |