From: Egor Date: Sun, 8 May 2022 13:50:42 +0000 (+0300) Subject: don't show secret channels in /LIST X-Git-Url: https://git.patchysicp.xyz/?a=commitdiff_plain;h=d4f6abdfdc4b84ee0ff8db34e22b77ebfb83ab89;p=patchyircd.git don't show secret channels in /LIST --- diff --git a/irc.c b/irc.c index 4e2fab0..0f6658d 100644 --- a/irc.c +++ b/irc.c @@ -631,9 +631,12 @@ int processPacket(struct client_data *client, char *source, char *command, int a if (trie_findfirst(&f, &channel_map) == 1) do { struct channel *chan = f->n->value; - copy_strf(&databuf, ":%s 322 %s %s %u :%s\n", hostname, client->nick, - chan->name, chan->member_count, chan->topic ? chan->topic : ""); - sendbuf(client); + if (!(chan->dmode & DMODE_SECRET) || trie_get(&chan->members, client->key)) { + channel_sendnames(client, chan); + copy_strf(&databuf, ":%s 322 %s %s %u :%s\n", hostname, client->nick, + chan->name, chan->member_count, chan->topic ? chan->topic : ""); + sendbuf(client); + } } while(trie_findnext(&f) == 1); copy_strf(&databuf, ":%s 323 %s :End of /LIST\n", hostname, client->nick); sendbuf(client);