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:
parent
9ac0390734
commit
cc75db3f3f
1 changed files with 9 additions and 0 deletions
|
@ -288,10 +288,19 @@ struct ev_entry *expire_override_deadlines_ev = NULL;
|
||||||
static int
|
static int
|
||||||
_modinit(void)
|
_modinit(void)
|
||||||
{
|
{
|
||||||
|
rb_dlink_node *ptr;
|
||||||
|
|
||||||
/* add the usermode to the available slot */
|
/* add the usermode to the available slot */
|
||||||
user_modes['p'] = find_umode_slot();
|
user_modes['p'] = find_umode_slot();
|
||||||
construct_umodebuf();
|
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);
|
expire_override_deadlines_ev = rb_event_add("expire_override_deadlines", expire_override_deadlines, NULL, 60);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue