+class BanWatcher : public ModeWatcher
+{
+ public:
+ BanWatcher(Module* parent)
+ : ModeWatcher(parent, "ban", MODETYPE_CHANNEL)
+ {
+ }
+
+ void AfterMode(User* source, User* dest, Channel* chan, const std::string& banmask, bool adding) CXX11_OVERRIDE
+ {
+ if (adding)
+ return;
+
+ for (timedbans::iterator i = TimedBanList.begin(); i != TimedBanList.end(); ++i)
+ {
+ if (i->chan != chan)
+ continue;
+
+ const std::string& target = i->mask;
+ if (irc::equals(banmask, target))
+ {
+ TimedBanList.erase(i);
+ break;
+ }
+ }
+ }
+};
+