diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-04-30 02:55:55 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-04-30 02:55:55 +0000 |
commit | c12ec889bb600626ecbd0cb903564f639ee55700 (patch) | |
tree | d0f7e0833f6aa48f4404f75335ca7c7fb4cad37e /src/modules | |
parent | e190c2ae913682fa5da83ccf53722289c3e7d77c (diff) |
Added OnAddBan and OnDelBan module api calls, and fixed glitch which required them in m_timedbans module
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1267 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/m_timedbans.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/modules/m_timedbans.cpp b/src/modules/m_timedbans.cpp index f75791b2c..8082831f0 100644 --- a/src/modules/m_timedbans.cpp +++ b/src/modules/m_timedbans.cpp @@ -108,6 +108,19 @@ class ModuleTimedBans : public Module TimedBanList.clear(); } + virtual int OnDelBan(userrec* source, chanrec* chan, std::string banmask) + { + for (timedbans::iterator i = TimedBanList.begin(); i < TimedBanList.end(); i++) + { + if (!strcasecmp(banmask.c_str(),i->mask.c_str())) + { + TimedBanList.erase(i); + break; + } + } + return 0; + } + virtual void OnBackgroundTimer(time_t curtime) { bool again = true; @@ -122,6 +135,7 @@ class ModuleTimedBans : public Module again = true; if (cr) { + Srv->SendChannelServerNotice(Srv->GetServerName(),cr,"NOTICE "+std::string(cr->name)+" :Timed ban on "+i->mask+" expired."); char *setban[3]; setban[0] = (char*)i->channel.c_str(); setban[1] = "-b"; @@ -135,9 +149,8 @@ class ModuleTimedBans : public Module temp->fd = FD_MAGIC_NUMBER; Srv->SendMode(setban,3,temp); delete temp; - Srv->SendChannelServerNotice(Srv->GetServerName(),cr,"NOTICE "+std::string(cr->name)+" :Timed ban on "+i->mask+" expired."); } - TimedBanList.erase(i); + // we used to delete the item here, but we dont need to as the servermode above does it for us, break; } } |