Add "Media" tab for rooms (#196)

* WIP on Media tab to rooms

* handle error for downloadFile if it's missing

* Add warning message for rooms Media tab

* Fix error message for download media of rooms

* update readme
This commit is contained in:
Borislav Pantaleev
2024-12-09 21:56:45 +02:00
committed by GitHub
parent 2fa5600d24
commit 402457640c
18 changed files with 190 additions and 22 deletions

View File

@@ -384,6 +384,20 @@ const resourceMap = {
data: "members",
total: json => json.total,
},
room_media: {
map: (mediaId: string) => ({
id: mediaId.replace("mxc://" + localStorage.getItem("home_server") + "/", ""),
media_id: mediaId.replace("mxc://" + localStorage.getItem("home_server") + "/", ""),
}),
reference: (id: Identifier) => ({
endpoint: `/_synapse/admin/v1/room/${id}/media`,
}),
total: json => json.total,
data: "local",
delete: (params: DeleteParams) => ({
endpoint: `/_synapse/admin/v1/media/${localStorage.getItem("home_server")}/${params.id}`,
}),
},
room_state: {
map: (rs: RoomState) => ({
...rs,