]> jfr.im git - solanum.git/commitdiff
operspy list: Show '!' prefix for otherwise hidden channels rather than +s ones.
authorJilles Tjoelker <redacted>
Mon, 23 May 2011 22:30:45 +0000 (00:30 +0200)
committerJilles Tjoelker <redacted>
Mon, 23 May 2011 22:30:45 +0000 (00:30 +0200)
This is consistent with operspy whois.

modules/m_list.c

index d60c832840418b94516db3bd377ba6220f8fceb4..d8f70607d298504516b25c2a2fd16fef59a48212 100644 (file)
@@ -367,6 +367,7 @@ static void safelist_channel_named(struct Client *source_p, const char *name, in
 {
        struct Channel *chptr;
        char *p;
+       int visible;
 
        sendto_one(source_p, form_str(RPL_LISTSTART), me.name, source_p->name);
 
@@ -389,9 +390,10 @@ static void safelist_channel_named(struct Client *source_p, const char *name, in
                return;
        }
 
-       if (!SecretChannel(chptr) || IsMember(source_p, chptr) || operspy)
+       visible = !SecretChannel(chptr) || IsMember(source_p, chptr);
+       if (visible || operspy)
                sendto_one(source_p, form_str(RPL_LIST), me.name, source_p->name,
-                          (operspy && SecretChannel(chptr)) ? "!" : "",
+                          visible ? "" : "!",
                           chptr->chname, rb_dlink_list_length(&chptr->members),
                           chptr->topic == NULL ? "" : chptr->topic);
 
@@ -410,8 +412,10 @@ static void safelist_channel_named(struct Client *source_p, const char *name, in
 static void safelist_one_channel(struct Client *source_p, struct Channel *chptr)
 {
        struct ListClient *safelist_data = source_p->localClient->safelist_data;
+       int visible;
 
-       if (SecretChannel(chptr) && !IsMember(source_p, chptr) && !safelist_data->operspy)
+       visible = !SecretChannel(chptr) || IsMember(source_p, chptr);
+       if (!visible && !safelist_data->operspy)
                return;
 
        if ((unsigned int)chptr->members.length < safelist_data->users_min
@@ -433,7 +437,7 @@ static void safelist_one_channel(struct Client *source_p, struct Channel *chptr)
                return;
 
        sendto_one(source_p, form_str(RPL_LIST), me.name, source_p->name,
-                  (safelist_data->operspy && SecretChannel(chptr)) ? "!" : "",
+                  visible ? "" : "!",
                   chptr->chname, rb_dlink_list_length(&chptr->members),
                   chptr->topic == NULL ? "" : chptr->topic);
 }