diff options
| author | Adam <Adam@anope.org> | 2013-10-05 01:07:51 -0400 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2013-10-05 01:07:51 -0400 |
| commit | 277f735505ccb16d6fcc15ad21af4325e58f3615 (patch) | |
| tree | ffb624a9ca629029f8cfed5e5e448f4a62468269 /modules/pseudoclients/chanserv.cpp | |
| parent | f63a2bdfb4e9230ad029b136d73076d92b0910ef (diff) | |
Hide expires in /cs info if the channel is actively in use as it confuses people
Diffstat (limited to 'modules/pseudoclients/chanserv.cpp')
| -rw-r--r-- | modules/pseudoclients/chanserv.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/modules/pseudoclients/chanserv.cpp b/modules/pseudoclients/chanserv.cpp index 9f8cdc52e..5a70aefd3 100644 --- a/modules/pseudoclients/chanserv.cpp +++ b/modules/pseudoclients/chanserv.cpp @@ -460,6 +460,16 @@ class ChanServCore : public Module, public ChanServService return EVENT_CONTINUE; } + + void OnChanInfo(CommandSource &source, ChannelInfo *ci, InfoFormatter &info, bool show_all) anope_override + { + if (!show_all) + return; + + time_t chanserv_expire = Config->GetModule(this)->Get<time_t>("expire", "14d"); + if (!ci->HasExt("CS_NO_EXPIRE") && chanserv_expire && !Anope::NoExpire && ci->last_used != Anope::CurTime) + info[_("Expires")] = Anope::strftime(ci->last_used + chanserv_expire, source.GetAccount()); + } }; MODULE_INIT(ChanServCore) |
