0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-09-29 20:28:52 +02:00

modules/client/directory/list/room: Complete the missing PUT functionality.

This commit is contained in:
Jason Volk 2019-03-14 15:08:00 -07:00
parent 2070a72850
commit 240c181b16

View file

@ -93,6 +93,25 @@ put__list_room(client &client,
request.at("visibility")
};
switch(hash(visibility))
{
case "public"_:
// We set an empty summary for this room because
// we already have its state on this server;
m::rooms::summary_set(room.room_id, json::object{});
break;
case "private"_:
m::rooms::summary_del(room.room_id);
break;
default: throw m::UNSUPPORTED
{
"visibility type '%s' is not supported here",
string_view{visibility}
};
}
return resource::response
{
client, http::OK