From: Egor Date: Fri, 27 May 2022 21:10:07 +0000 (+0300) Subject: fix +0 X-Git-Url: https://git.patchysicp.xyz/?a=commitdiff_plain;h=42755b214ca24693381eeb8db24950eed4a1b1ea;p=patchyircd.git fix +0 --- diff --git a/irc.c b/irc.c index 3f01dde..55d5aa9 100644 --- a/irc.c +++ b/irc.c @@ -619,37 +619,43 @@ int processPacket(struct client_data *client, char *source, char *command, int a if (argc == 2) { // Type A channel modes struct trie_find *f = NULL; int all = !strcmp(args[1], "+0"); + int any = 0; if (all) { rpl_channelmodeis(client, chan), sendbuf(client); rpl_creationtime(client, chan), sendbuf(client); + any = 1; } if (all || !strcmp(args[1], "+b") || !strcmp(args[1], "b")) { if (trie_findfirst(&f, &chan->listb) == 1) do { rpl_banlist(client, chan, f->key), sendbuf(client); } while(trie_findnext(&f) == 1); - return rpl_endofbanlist(client, chan), sendbuf(client), 0; + rpl_endofbanlist(client, chan), sendbuf(client); + any = 1; } if (all || !strcmp(args[1], "+e") || !strcmp(args[1], "e")) { if (trie_findfirst(&f, &chan->liste) == 1) do { rpl_exceptlist(client, chan, f->key), sendbuf(client); } while(trie_findnext(&f) == 1); - return rpl_endofexceptlist(client, chan), sendbuf(client), 0; + rpl_endofexceptlist(client, chan), sendbuf(client); + any = 1; } if (all || !strcmp(args[1], "+I") || !strcmp(args[1], "I")) { if (trie_findfirst(&f, &chan->listI) == 1) do { rpl_invexlist(client, chan, f->key), sendbuf(client); } while(trie_findnext(&f) == 1); - return rpl_endofinvexlist(client, chan), sendbuf(client), 0; + rpl_endofinvexlist(client, chan), sendbuf(client); + any = 1; } if (all || !strcmp(args[1], "+q") || !strcmp(args[1], "q")) { if (trie_findfirst(&f, &chan->listq) == 1) do { rpl_quietlist(client, chan, f->key), sendbuf(client); } while(trie_findnext(&f) == 1); - return rpl_endofquietlist(client, chan), sendbuf(client), 0; + rpl_endofquietlist(client, chan), sendbuf(client); + any = 1; } if (all || !strcmp(args[1], "+w") || !strcmp(args[1], "w")) { if (trie_findfirst(&f, &chan->listwo) == 1) @@ -660,8 +666,11 @@ int processPacket(struct client_data *client, char *source, char *command, int a do { rpl_accesslist(client, chan, 'v', f->key), sendbuf(client); } while(trie_findnext(&f) == 1); - return rpl_endofaccesslist(client, chan), sendbuf(client), 0; + rpl_endofaccesslist(client, chan), sendbuf(client); + any = 1; } + if (any) + return 0; } int is_plus; char *p = args[1];