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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user