diff --git a/modules/um_callerid.c b/modules/um_callerid.c index bfc94fd8..56394986 100644 --- a/modules/um_callerid.c +++ b/modules/um_callerid.c @@ -90,12 +90,13 @@ static const char um_callerid_desc[] = static bool has_common_channel(struct Client *source_p, struct Client *target_p) { - rb_dlink_node *ptr; + rb_dlink_node *ps, *pt; + struct membership *ms, *mt; + struct Channel *chptr; - RB_DLINK_FOREACH(ptr, source_p->user->channel.head) + ITER_COMM_CHANNELS(ps, pt, source_p->user->channel.head, target_p->user->channel.head, ms, mt, chptr) { - struct membership *msptr = ptr->data; - if (IsMember(target_p, msptr->chptr)) + if (ms != NULL && mt != NULL) return true; }