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:
parent
2070a72850
commit
240c181b16
1 changed files with 19 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue