From 5829d7da39cd92c2590c281a931ae7a032da1842 Mon Sep 17 00:00:00 2001 From: Adam Date: Thu, 26 Dec 2013 12:06:39 -0500 Subject: Add a config option for whether or not to reset the TS of persistent channels to their registration date --- modules/commands/cs_set.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'modules/commands/cs_set.cpp') diff --git a/modules/commands/cs_set.cpp b/modules/commands/cs_set.cpp index 0c5e9b6c6..f4c7e176d 100644 --- a/modules/commands/cs_set.cpp +++ b/modules/commands/cs_set.cpp @@ -1198,6 +1198,8 @@ class CSSet : public Module CommandCSSetSuccessor commandcssetsuccessor; CommandCSSetNoexpire commandcssetnoexpire; + bool persist_lower_ts; + public: CSSet(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR), noautoop(this, "NOAUTOOP"), peace(this, "PEACE"), @@ -1214,6 +1216,11 @@ class CSSet : public Module { } + void OnReload(Configuration::Conf *conf) anope_override + { + persist_lower_ts = conf->GetModule(this)->Get("persist_lower_ts"); + } + void OnCreateChan(ChannelInfo *ci) anope_override { ci->bantype = Config->GetModule(this)->Get("defbantype", "2"); @@ -1296,7 +1303,7 @@ class CSSet : public Module void OnJoinChannel(User *u, Channel *c) anope_override { - if (c->ci && persist.HasExt(c->ci) && c->creation_time > c->ci->time_registered) + if (persist_lower_ts && c->ci && persist.HasExt(c->ci) && c->creation_time > c->ci->time_registered) { Log(LOG_DEBUG) << "Changing TS of " << c->name << " from " << c->creation_time << " to " << c->ci->time_registered; c->creation_time = c->ci->time_registered; -- cgit