From 8093dc5fb74c216f7e7e698f8793af7f5b0318a4 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Fri, 16 Sep 2016 12:56:18 -0500 Subject: [PATCH] helpops: handle cleaning up remote opers from the helpops list --- extensions/helpops.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/extensions/helpops.c b/extensions/helpops.c index c2a7e00c..183229fa 100644 --- a/extensions/helpops.c +++ b/extensions/helpops.c @@ -161,8 +161,23 @@ h_hdl_new_remote_user(struct Client *client_p) static void h_hdl_client_exit(hook_data_client_exit *hdata) { - if (hdata->target->umodes & UMODE_HELPOPS) - rb_dlinkFindDestroy(hdata->target, &helper_list); + if (MyClient(hdata->target) && IsPerson(hdata->target)) + { + if (hdata->target->umodes & UMODE_HELPOPS) + rb_dlinkFindDestroy(hdata->target, &helper_list); + } + else if (IsServer(hdata->target)) + { + rb_dlink_node *nptr; + + RB_DLINK_FOREACH(nptr, hdata->target->serv->users.head) + { + struct Client *client_p = nptr->data; + + if (client_p->umodes & UMODE_HELPOPS) + rb_dlinkFindDestroy(client_p, &helper_list); + } + } } static void