]> jfr.im git - solanum.git/blobdiff - modules/um_callerid.c
Kill Travis
[solanum.git] / modules / um_callerid.c
index cbd495de7eddf74c5f88725ee3d358936198d9f4..56394986a3ee80de0ed7531f04fbc09e7861403c 100644 (file)
@@ -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;
        }
 
@@ -118,7 +119,7 @@ allow_message(struct Client *source_p, struct Client *target_p)
                return true;
 
        /* XXX: controversial?  allow opers to send through +g */
-       if (IsOper(source_p))
+       if (IsOperGeneral(source_p))
                return true;
 
        if (accept_message(source_p, target_p))
@@ -168,7 +169,7 @@ add_callerid_accept_for_source(enum message_type msgtype, struct Client *source_
        if(msgtype != MESSAGE_TYPE_NOTICE &&
                IsSetAnyCallerID(source_p) &&
                !accept_message(target_p, source_p) &&
-               !IsOper(target_p))
+               !IsOperGeneral(target_p))
        {
                if(rb_dlink_list_length(&source_p->localClient->allow_list) <
                                (unsigned long)ConfigFileEntry.max_accept)
@@ -180,7 +181,7 @@ add_callerid_accept_for_source(enum message_type msgtype, struct Client *source_
                {
                        sendto_one_numeric(source_p, ERR_OWNMODE,
                                        form_str(ERR_OWNMODE),
-                                       target_p->name, "+g");
+                                       target_p->name, IsSetStrictCallerID(target_p) ? "+g" : "+G");
                        return false;
                }
        }
@@ -209,7 +210,7 @@ h_hdl_invite(void *vdata)
                return;
 
        snprintf(errorbuf, sizeof errorbuf, form_str(ERR_TARGUMODEG),
-                target_p->name);
+                target_p->name, IsSetStrictCallerID(target_p) ? "+g" : "+G");
 
        data->approved = ERR_TARGUMODEG;
        data->error = errorbuf;