33 std::optional<std::string>
name;
36 std::optional<std::string>
topic;
57 if (! jo.is_object()) { jo = json::object(); }
62 jo[
"room_id"s] = pod.
roomId;
82 if (jo.contains(
"num_joined_members"s)) {
85 if (jo.contains(
"room_id"s)) {
86 result.
roomId = jo.at(
"room_id"s);
88 if (jo.contains(
"world_readable"s)) {
91 if (jo.contains(
"guest_can_join"s)) {
94 if (jo.contains(
"canonical_alias"s)) {
97 if (jo.contains(
"name"s)) {
98 result.
name = jo.at(
"name"s);
100 if (jo.contains(
"topic"s)) {
101 result.
topic = jo.at(
"topic"s);
103 if (jo.contains(
"avatar_url"s)) {
106 if (jo.contains(
"join_rule"s)) {
107 result.
joinRule = jo.at(
"join_rule"s);
Definition: location.hpp:10
Definition: location.hpp:10
void addToJsonIfNeeded(json &j, std::string name, T &&arg)
Definition: types.hpp:80
nlohmann::json json
Definition: jsonwrap.hpp:20
Definition: location.hpp:27
Definition: public_rooms_response.hpp:13
std::optional< std::string > avatarUrl
The URL for the room's avatar, if one is set.
Definition: public_rooms_response.hpp:39
std::optional< std::string > name
The name of the room, if any.
Definition: public_rooms_response.hpp:33
bool worldReadable
Whether the room may be viewed by guest users without joining.
Definition: public_rooms_response.hpp:22
int numJoinedMembers
The number of members joined to the room.
Definition: public_rooms_response.hpp:16
std::optional< std::string > joinRule
The room's join rule.
Definition: public_rooms_response.hpp:45
bool guestCanJoin
Whether guest users may join the room and participate in it.
Definition: public_rooms_response.hpp:27
std::optional< std::string > topic
The topic of the room, if any.
Definition: public_rooms_response.hpp:36
std::optional< std::string > canonicalAlias
The canonical alias of the room, if any.
Definition: public_rooms_response.hpp:30
std::string roomId
The ID of the room.
Definition: public_rooms_response.hpp:19
static void from_json(const json &jo, PublicRoomsChunk &result)
Definition: public_rooms_response.hpp:79
static void to_json(json &jo, const PublicRoomsChunk &pod)
Definition: public_rooms_response.hpp:55