From 3097037c3dc882be2efe64dce6aefeea43d5f040 Mon Sep 17 00:00:00 2001 From: Konstantinos Sideris Date: Mon, 30 Apr 2018 21:41:47 +0300 Subject: Add prototype room settings menu --- include/Cache.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include/Cache.h') diff --git a/include/Cache.h b/include/Cache.h index a92f6bc5..db5dba00 100644 --- a/include/Cache.h +++ b/include/Cache.h @@ -64,6 +64,8 @@ struct RoomInfo std::string avatar_url; //! Whether or not the room is an invite. bool is_invite = false; + //! Total number of members in the room. + int16_t member_count = 0; }; inline void @@ -73,6 +75,9 @@ to_json(json &j, const RoomInfo &info) j["topic"] = info.topic; j["avatar_url"] = info.avatar_url; j["is_invite"] = info.is_invite; + + if (info.member_count != 0) + j["member_count"] = info.member_count; } inline void @@ -82,6 +87,9 @@ from_json(const json &j, RoomInfo &info) info.topic = j.at("topic"); info.avatar_url = j.at("avatar_url"); info.is_invite = j.at("is_invite"); + + if (j.count("member_count")) + info.member_count = j.at("member_count"); } //! Basic information per member; -- cgit 1.5.1