From bbf869eada4e22f0c5b271885574275f88147af2 Mon Sep 17 00:00:00 2001 From: Bram Matthys Date: Wed, 11 Aug 2021 09:20:25 +0200 Subject: [PATCH] Newlog: expand channel data more --- src/log.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/log.c b/src/log.c index 1889f8c79..5e08a8369 100644 --- a/src/log.c +++ b/src/log.c @@ -517,7 +517,15 @@ void json_expand_channel(json_t *j, char *key, Channel *channel, int detail) json_t *child = json_object(); json_object_set_new(j, key, child); json_object_set_new(child, "name", json_string_unreal(channel->name)); - // TODO: expand more, obviously! + json_object_set_new(child, "creation_time", json_timestamp(channel->creationtime)); + json_object_set_new(child, "num_users", json_integer(channel->users)); + if (channel->topic) + { + json_object_set_new(child, "topic", json_string_unreal(channel->topic)); + json_object_set_new(child, "topic_set_by", json_string_unreal(channel->topic_nick)); + json_object_set_new(child, "topic_set_at", json_timestamp(channel->topic_time)); + } + // Possibly later: If detail is set to 1 then expand modes, mode_lock, .. } char *timestamp_iso8601_now(void)