override: start timers for +p clients on modinit

Reloading override previously would have the effect of cancelling +p
expiry. With this change, reloading the module just refreshes the
timers, so expiry is delayed a bit rather than forgotten entirely.
This commit is contained in:
Ed Kellett 2019-07-27 01:48:36 +01:00
parent 9ac0390734
commit cc75db3f3f
No known key found for this signature in database
GPG key ID: CB9986DEF342FABC

View file

@ -288,10 +288,19 @@ struct ev_entry *expire_override_deadlines_ev = NULL;
static int
_modinit(void)
{
rb_dlink_node *ptr;
/* add the usermode to the available slot */
user_modes['p'] = find_umode_slot();
construct_umodebuf();
RB_DLINK_FOREACH(ptr, lclient_list.head)
{
struct Client *client_p = ptr->data;
if (IsPerson(client_p) && (client_p->umodes & user_modes['p']))
update_session_deadline(client_p, NULL);
}
expire_override_deadlines_ev = rb_event_add("expire_override_deadlines", expire_override_deadlines, NULL, 60);
return 0;