Compare commits
6 Commits
4d9909fe80
...
renovate/e
| Author | SHA1 | Date | |
|---|---|---|---|
| 52acbe6d90 | |||
| a5ad5973b7 | |||
| 01b1434e37 | |||
| 7a60460973 | |||
| a8cfdaf287 | |||
| f13fac582b |
@@ -115,17 +115,31 @@ pub struct RoomIdInPath {
|
|||||||
pub(crate) room_id: OwnedRoomId,
|
pub(crate) room_id: OwnedRoomId,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(serde::Deserialize)]
|
||||||
|
pub struct SingleRoomQuery {
|
||||||
|
#[serde(default)]
|
||||||
|
pub with_latest_event: bool,
|
||||||
|
}
|
||||||
|
|
||||||
/// Get the list of joined rooms of the user
|
/// Get the list of joined rooms of the user
|
||||||
pub async fn single_room_info(
|
pub async fn single_room_info(
|
||||||
client: MatrixClientExtractor,
|
client: MatrixClientExtractor,
|
||||||
path: web::Path<RoomIdInPath>,
|
path: web::Path<RoomIdInPath>,
|
||||||
|
query: web::Query<SingleRoomQuery>,
|
||||||
) -> HttpResult {
|
) -> HttpResult {
|
||||||
let notifs = client.client.client.notification_settings().await;
|
let notifs = client.client.client.notification_settings().await;
|
||||||
|
|
||||||
Ok(match client.client.client.get_room(&path.room_id) {
|
let Some(room) = client.client.client.get_room(&path.room_id) else {
|
||||||
None => HttpResponse::NotFound().json("Room not found"),
|
return Ok(HttpResponse::NotFound().json("Room not found"));
|
||||||
Some(r) => HttpResponse::Ok().json(APIRoomInfo::from_room(&r, ¬ifs).await?),
|
};
|
||||||
})
|
|
||||||
|
let mut room_info = APIRoomInfo::from_room(&room, ¬ifs).await?;
|
||||||
|
|
||||||
|
if !query.with_latest_event {
|
||||||
|
room_info.latest_event = None;
|
||||||
|
}
|
||||||
|
|
||||||
|
Ok(HttpResponse::Ok().json(room_info))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get room avatar
|
/// Get room avatar
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
"@mui/material": "^7.3.8",
|
"@mui/material": "^7.3.8",
|
||||||
"@mui/x-data-grid": "^8.27.4",
|
"@mui/x-data-grid": "^8.27.4",
|
||||||
"@mui/x-date-pickers": "^8.27.2",
|
"@mui/x-date-pickers": "^8.27.2",
|
||||||
"date-and-time": "^4.3.0",
|
"date-and-time": "^4.3.1",
|
||||||
"dayjs": "^1.11.19",
|
"dayjs": "^1.11.19",
|
||||||
"emoji-picker-react": "^4.18.0",
|
"emoji-picker-react": "^4.18.0",
|
||||||
"filesize": "^11.0.13",
|
"filesize": "^11.0.13",
|
||||||
@@ -35,7 +35,7 @@
|
|||||||
"@types/react": "^19.2.14",
|
"@types/react": "^19.2.14",
|
||||||
"@types/react-dom": "^19.2.3",
|
"@types/react-dom": "^19.2.3",
|
||||||
"@vitejs/plugin-react": "^5.1.4",
|
"@vitejs/plugin-react": "^5.1.4",
|
||||||
"eslint": "^9.39.3",
|
"eslint": "^10.0.3",
|
||||||
"eslint-plugin-react-hooks": "^7.0.1",
|
"eslint-plugin-react-hooks": "^7.0.1",
|
||||||
"eslint-plugin-react-refresh": "^0.5.2",
|
"eslint-plugin-react-refresh": "^0.5.2",
|
||||||
"globals": "^17.4.0",
|
"globals": "^17.4.0",
|
||||||
|
|||||||
Reference in New Issue
Block a user