]> jfr.im git - solanum.git/blobdiff - ircd/tgchange.c
Track and inform modules of privset changes
[solanum.git] / ircd / tgchange.c
index 0db3a1948910c27dfc84bb173fb92faf6e330f6f..1f4ebdc083fb35f4ecbdfb60c7bbb8cd1e92ec9f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * charybdis: an advanced Internet Relay Chat Daemon(ircd).
+ * Solanum: a slightly advanced ircd
  * tgchange.c - code for restricting private messages
  *
  * Copyright (C) 2004-2005 Lee Hardy <lee@leeh.co.uk>
@@ -38,14 +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 *ptr;
-       struct membership *msptr;
+       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)
        {
-               msptr = ptr->data;
-               if (is_chanop_voiced(msptr) && IsMember(target_p, msptr->chptr))
-                       return msptr->chptr;
+               if (ms != NULL && mt != NULL && is_chanop_voiced(ms))
+                       return chptr;
        }
        return NULL;
 }