mirror of
https://github.com/anope/anope.git
synced 2026-07-06 04:53:13 +02:00
@@ -210,6 +210,13 @@ class CSSuspend : public Module
|
||||
}
|
||||
};
|
||||
|
||||
void Expire(ChannelInfo *ci)
|
||||
{
|
||||
suspend.Unset(ci);
|
||||
Log(this) << "Expiring suspend for " << ci->name;
|
||||
}
|
||||
|
||||
|
||||
bool Show(CommandSource &source, const Anope::string &what) const
|
||||
{
|
||||
return source.IsOper() || std::find(show.begin(), show.end(), what) != show.end();
|
||||
@@ -255,23 +262,28 @@ class CSSuspend : public Module
|
||||
|
||||
expire = false;
|
||||
|
||||
if (!si->expires)
|
||||
return;
|
||||
|
||||
if (si->expires < Anope::CurTime)
|
||||
if (si->expires && si->expires < Anope::CurTime)
|
||||
{
|
||||
ci->last_used = Anope::CurTime;
|
||||
suspend.Unset(ci);
|
||||
|
||||
Log(this) << "Expiring suspend for " << ci->name;
|
||||
Expire(ci);
|
||||
}
|
||||
}
|
||||
|
||||
EventReturn OnCheckKick(User *u, Channel *c, Anope::string &mask, Anope::string &reason) anope_override
|
||||
{
|
||||
if (u->HasMode("OPER") || !c->ci || !suspend.HasExt(c->ci))
|
||||
if (u->HasMode("OPER") || !c->ci)
|
||||
return EVENT_CONTINUE;
|
||||
|
||||
CSSuspendInfo *si = suspend.Get(c->ci);
|
||||
if (!si)
|
||||
return EVENT_CONTINUE;
|
||||
|
||||
if (si->expires && si->expires < Anope::CurTime)
|
||||
{
|
||||
Expire(c->ci);
|
||||
return EVENT_CONTINUE;
|
||||
}
|
||||
|
||||
reason = Language::Translate(u, _("This channel may not be used."));
|
||||
return EVENT_STOP;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user