diff options
Diffstat (limited to 'modules/commands/ns_suspend.cpp')
-rw-r--r-- | modules/commands/ns_suspend.cpp | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/modules/commands/ns_suspend.cpp b/modules/commands/ns_suspend.cpp index cf2b19834..fc445a1dc 100644 --- a/modules/commands/ns_suspend.cpp +++ b/modules/commands/ns_suspend.cpp @@ -222,6 +222,12 @@ class NSSuspend : public Module return source.IsOper() || std::find(show.begin(), show.end(), what) != show.end(); } + void Expire(NickAlias *na) + { + suspend.Unset(na->nc); + Log(LOG_NORMAL, "nickserv/expire", Config->GetClient("NickServ")) << "Expiring suspend for " << na->nick; + } + public: NSSuspend(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR), commandnssuspend(this), commandnsunsuspend(this), suspend(this, "NS_SUSPENDED"), @@ -262,15 +268,10 @@ class NSSuspend : public Module expire = false; - if (!s->expires) - return; - - if (s->expires < Anope::CurTime) + if (s->expires && s->expires < Anope::CurTime) { na->last_seen = Anope::CurTime; - suspend.Unset(na->nc); - - Log(LOG_NORMAL, "nickserv/expire", Config->GetClient("NickServ")) << "Expiring suspend for " << na->nick; + Expire(na); } } @@ -280,6 +281,12 @@ class NSSuspend : public Module if (!s) return EVENT_CONTINUE; + if (s->expires && s->expires < Anope::CurTime) + { + Expire(na); + return EVENT_CONTINUE; + } + u->SendMessage(Config->GetClient("NickServ"), NICK_X_SUSPENDED, u->nick.c_str()); return EVENT_STOP; } |