1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-07 21:23:12 +02:00

Newlog: expand channel data more

This commit is contained in:
Bram Matthys
2021-08-11 09:20:25 +02:00
parent 78f16710c4
commit bbf869eada
+9 -1
View File
@@ -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)