diff options
| author | Adam <Adam@anope.org> | 2013-08-11 17:14:39 -0400 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2013-08-11 17:14:39 -0400 |
| commit | f1956b039d3c7be38ad03fbb79be6a4eed440cf0 (patch) | |
| tree | 483b29cf3c67af4742945213eb88a173ae5b6d6a /modules/pseudoclients | |
| parent | 53d5b7c29ea2f0164b562549cef579fe2b276abf (diff) | |
Remove channels from accesss lists when they expire/drop
Diffstat (limited to 'modules/pseudoclients')
| -rw-r--r-- | modules/pseudoclients/chanserv.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/modules/pseudoclients/chanserv.cpp b/modules/pseudoclients/chanserv.cpp index 07d997aa4..e1d98e64c 100644 --- a/modules/pseudoclients/chanserv.cpp +++ b/modules/pseudoclients/chanserv.cpp @@ -199,6 +199,32 @@ class ChanServCore : public Module, public ChanServService } } + void OnDelChan(ChannelInfo *ci) anope_override + { + /* remove access entries that are this channel */ + + std::deque<Anope::string> chans; + ci->GetChannelReferences(chans); + + for (unsigned i = 0; i < chans.size(); ++i) + { + ChannelInfo *c = ChannelInfo::Find(chans[i]); + if (!c) + continue; + + for (unsigned j = 0; j < c->GetAccessCount(); ++j) + { + ChanAccess *a = c->GetAccess(j); + + if (a->mask.equals_ci(ci->name)) + { + delete a; + break; + } + } + } + } + EventReturn OnPreHelp(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override { if (!params.empty() || source.c || source.service != *ChanServ) |
