0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-29 18:22:50 +01:00

ircd:Ⓜ️:rooms::summary: Ensure properties appear in /publicRooms response.

This commit is contained in:
Jason Volk 2023-02-22 14:16:55 -08:00
parent 73f4a68b8f
commit 21bc6c4e97

View file

@ -372,7 +372,7 @@ ircd::m::rooms::summary::chunk_local(const m::room &room,
state.get(std::nothrow, type, "")
};
m::get(std::nothrow, event_idx, "content", [&content_key, &closure]
return m::get(std::nothrow, event_idx, "content", [&content_key, &closure]
(const json::object &content)
{
const json::string &value
@ -384,6 +384,13 @@ ircd::m::rooms::summary::chunk_local(const m::room &room,
});
}};
const auto required{[&query]
(const auto &type, const auto &content_key, const auto &closure)
{
if(!query(type, content_key, closure))
closure(string_view{});
}};
// Aliases array
{
json::stack::member aliases_m{obj, "aliases"};
@ -438,7 +445,7 @@ ircd::m::rooms::summary::chunk_local(const m::room &room,
});
}
query("m.room.guest_access", "guest_access", [&obj]
required("m.room.guest_access", "guest_access", [&obj]
(const string_view &value)
{
json::stack::member
@ -488,7 +495,7 @@ ircd::m::rooms::summary::chunk_local(const m::room &room,
};
});
query("m.room.history_visibility", "history_visibility", [&obj]
required("m.room.history_visibility", "history_visibility", [&obj]
(const string_view &value)
{
json::stack::member