summary refs log tree commit diff
path: root/include/Cache.h
diff options
context:
space:
mode:
authorKonstantinos Sideris <sideris.konstantin@gmail.com>2018-04-30 21:41:47 +0300
committerKonstantinos Sideris <sideris.konstantin@gmail.com>2018-04-30 21:41:47 +0300
commit3097037c3dc882be2efe64dce6aefeea43d5f040 (patch)
tree1e3375fbd423c3bd18513e6d2a502b7fa1e4cfb8 /include/Cache.h
parentShow room tooltips when the sidebar is collapsed (diff)
downloadnheko-3097037c3dc882be2efe64dce6aefeea43d5f040.tar.xz
Add prototype room settings menu
Diffstat (limited to 'include/Cache.h')
-rw-r--r--include/Cache.h8
1 files changed, 8 insertions, 0 deletions
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;