From bef2f428f425165fc928e99e42bd87a74c0d2c9e Mon Sep 17 00:00:00 2001 From: Bram Matthys Date: Thu, 5 Jan 2023 16:52:56 +0100 Subject: [PATCH] JSON-RPC: Really show *all* channels a user in. This because for JSON-RPC you expect all accurate data, while in contrast with JSON logging the channels are just there for convenience and only show the first X channels, since otherwise the data gets too long and gets truncated (JSON logging uses channel detail level 0). --- src/json.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/json.c b/src/json.c index 58670bc49..9a15e1eea 100644 --- a/src/json.c +++ b/src/json.c @@ -255,7 +255,8 @@ void json_expand_client(json_t *j, const char *key, Client *client, int detail) json_object_set_new(user, "channels", channels); for (m = client->user->channel; m; m = m->next) { - len += json_dump_string_length(m->channel->name); + if (detail < 1) // Limit at detail level 0, but show everything at level 1 and above + len += json_dump_string_length(m->channel->name); if (len > 384) { /* Truncated */