summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2012-01-24 16:35:54 -0500
committerAdam <Adam@anope.org>2012-01-24 16:35:54 -0500
commitd06cdaab2980e1275906812978e7e35e6ba66e4c (patch)
tree4472413e7e9070b29950b2c4fe265d3f7034b913
parentfc20bd7b22023be1f416ef4daa20f90c0dba84b0 (diff)
Fixed os_ignore to check against users real IPs, not to match against opers, and check for expired ignores on /os ignore list
-rw-r--r--modules/commands/os_ignore.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/modules/commands/os_ignore.cpp b/modules/commands/os_ignore.cpp
index 9071bbeff..526e19775 100644
--- a/modules/commands/os_ignore.cpp
+++ b/modules/commands/os_ignore.cpp
@@ -92,7 +92,7 @@ class OSIgnoreService : public IgnoreService
for (; ign != ign_end; ++ign)
{
Entry ignore_mask(CMODE_BEGIN, ign->mask);
- if (ignore_mask.Matches(u))
+ if (ignore_mask.Matches(u, true))
break;
}
}
@@ -183,7 +183,21 @@ class CommandOSIgnore : public Command
if (!ignore_service)
return;
- const std::list<IgnoreData> &ignores = ignore_service->GetIgnores();
+ std::list<IgnoreData> &ignores = ignore_service->GetIgnores();
+
+ for (std::list<IgnoreData>::iterator it = ignores.begin(), next_it; it != ignores.end(); it = next_it)
+ {
+ IgnoreData &id = *it;
+ next_it = it;
+ ++next_it;
+
+ if (id.time && id.time <= Anope::CurTime)
+ {
+ Log(LOG_DEBUG) << "Expiring ignore entry " << id.mask;
+ ignores.erase(it);
+ }
+ }
+
if (ignores.empty())
source.Reply(_("Ignore list is empty."));
else
@@ -306,7 +320,7 @@ class OSIgnore : public Module
EventReturn OnBotPrivmsg(User *u, BotInfo *bi, Anope::string &message)
{
- if (this->osignoreservice.Find(u->nick))
+ if (!u->HasMode(UMODE_OPER) && this->osignoreservice.Find(u->nick))
return EVENT_STOP;
return EVENT_CONTINUE;