]> jfr.im git - solanum.git/blobdiff - ircd/tgchange.c
doc/reference.conf: document the auth::umodes configuration option
[solanum.git] / ircd / tgchange.c
index c8e595aab8f0548b60ae9597f932dd647ca41eed..1f4ebdc083fb35f4ecbdfb60c7bbb8cd1e92ec9f 100644 (file)
@@ -38,29 +38,14 @@ static int add_hashed_target(struct Client *source_p, uint32_t hashv);
 struct Channel *
 find_allowing_channel(struct Client *source_p, struct Client *target_p)
 {
-       rb_dlink_node *ps = source_p->user->channel.head;
-       rb_dlink_node *pt = target_p->user->channel.head;
+       rb_dlink_node *ps, *pt;
+       struct membership *ms, *mt;
+       struct Channel *chptr;
 
-       while (ps && pt)
+       ITER_COMM_CHANNELS(ps, pt, source_p->user->channel.head, target_p->user->channel.head, ms, mt, chptr)
        {
-               struct membership *ms = ps->data;
-               struct membership *mt = pt->data;
-               int d;
-               if (ms->chptr == mt->chptr)
-               {
-                       if (is_chanop_voiced(ms))
-                               return ms->chptr;
-                       ps = ps->next;
-                       pt = pt->next;
-                       continue;
-               }
-               d = irccmp(ms->chptr->chname, mt->chptr->chname);
-               if (d < 0)
-                       ps = ps->next;
-               else if (d > 0)
-                       pt = pt->next;
-               else
-                       assert("different channels can't have equal names" && false);
+               if (ms != NULL && mt != NULL && is_chanop_voiced(ms))
+                       return chptr;
        }
        return NULL;
 }