From 369ca89c2e0ee4b4944817bd30c06a55567b749f Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 21 Jan 2013 06:46:28 -0500 Subject: [PATCH] Allow channels that have users in them that are not the access list to expire while in use. --- modules/pseudoclients/chanserv.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/modules/pseudoclients/chanserv.cpp b/modules/pseudoclients/chanserv.cpp index 3efc23711..0beb610ee 100644 --- a/modules/pseudoclients/chanserv.cpp +++ b/modules/pseudoclients/chanserv.cpp @@ -30,8 +30,18 @@ class ExpireCallback : public CallBack bool expire = false; - if (!ci->c && Anope::CurTime - ci->last_used >= Config->CSExpire) - expire = true; + if (Anope::CurTime - ci->last_used >= Config->CSExpire) + { + if (ci->c) + { + time_t last_used = ci->last_used; + for (User::ChanUserList::const_iterator cit = ci->c->users.begin(), cit_end = ci->c->users.end(); cit != cit_end && last_used == ci->last_used; ++cit) + ci->AccessFor((*cit)->user); + expire = last_used == ci->last_used; + } + else + expire = true; + } if (ci->HasFlag(CI_NO_EXPIRE)) expire = false;