Add the lists of public rooms on the server (#105)

* Add room directory and the switches to rooms settings

* Fix react admin version
This commit is contained in:
Dirk Klimpel
2021-05-04 13:52:43 +02:00
committed by GitHub
parent 0268cc0e94
commit 2ab4343970
7 changed files with 381 additions and 40 deletions

View File

@@ -195,6 +195,30 @@ const resourceMap = {
return json.total;
},
},
room_directory: {
path: "/_matrix/client/r0/publicRooms",
map: rd => ({
...rd,
id: rd.room_id,
public: !!rd.public,
guest_access: !!rd.guest_access,
avatar_src: mxcUrlToHttp(rd.avatar_url),
}),
data: "chunk",
total: json => {
return json.total_room_count_estimate;
},
create: params => ({
endpoint: `/_matrix/client/r0/directory/list/room/${params.id}`,
body: { visibility: "public" },
method: "PUT",
}),
delete: params => ({
endpoint: `/_matrix/client/r0/directory/list/room/${params.id}`,
body: { visibility: "private" },
method: "PUT",
}),
},
};
function filterNullValues(key, value) {