mirror of
https://github.com/UA-Fediland/synapse-admin.git
synced 2025-12-10 09:04:55 +00:00
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:
parent
0268cc0e94
commit
2ab4343970
7 changed files with 381 additions and 40 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue