diff options
author | Adam <Adam@anope.org> | 2013-01-21 06:46:28 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2013-01-21 06:46:28 -0500 |
commit | 369ca89c2e0ee4b4944817bd30c06a55567b749f (patch) | |
tree | a666bb0113b4998a7f5a5acb5f969317db670f80 | |
parent | 421db7552897aa94eec2aa6d95eb93aaacf82528 (diff) |
Allow channels that have users in them that are not the access list to expire while in use.
-rw-r--r-- | modules/pseudoclients/chanserv.cpp | 14 |
1 files 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; |