Compare commits
9 Commits
620c14c2cd
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| a5ad5973b7 | |||
| 01b1434e37 | |||
| 7a60460973 | |||
| a8cfdaf287 | |||
| f13fac582b | |||
| 4d9909fe80 | |||
| 13d20ff4fb | |||
| 51d14df6bb | |||
| 9c0af4d7d3 |
4
matrixgw_backend/Cargo.lock
generated
4
matrixgw_backend/Cargo.lock
generated
@@ -5621,9 +5621,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
|
||||
|
||||
[[package]]
|
||||
name = "tokio"
|
||||
version = "1.50.0"
|
||||
version = "1.49.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "27ad5e34374e03cfffefc301becb44e9dc3c17584f414349ebe29ed26661822d"
|
||||
checksum = "72a2903cd7736441aac9df9d7688bd0ce48edccaadf181c3b90be801e81d3d86"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"libc",
|
||||
|
||||
@@ -9,7 +9,7 @@ log = "0.4.29"
|
||||
clap = { version = "4.5.60", features = ["derive", "env"] }
|
||||
anyhow = "1.0.102"
|
||||
serde = { version = "1.0.228", features = ["derive"] }
|
||||
tokio = { version = "1.50.0", features = ["full"] }
|
||||
tokio = { version = "1.49.0", features = ["full"] }
|
||||
actix-web = "4.13.0"
|
||||
actix-session = { version = "0.11.0", features = ["redis-session"] }
|
||||
actix-remote-ip = "0.1.0"
|
||||
|
||||
@@ -115,17 +115,31 @@ pub struct RoomIdInPath {
|
||||
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
|
||||
pub async fn single_room_info(
|
||||
client: MatrixClientExtractor,
|
||||
path: web::Path<RoomIdInPath>,
|
||||
query: web::Query<SingleRoomQuery>,
|
||||
) -> HttpResult {
|
||||
let notifs = client.client.client.notification_settings().await;
|
||||
|
||||
Ok(match client.client.client.get_room(&path.room_id) {
|
||||
None => HttpResponse::NotFound().json("Room not found"),
|
||||
Some(r) => HttpResponse::Ok().json(APIRoomInfo::from_room(&r, ¬ifs).await?),
|
||||
})
|
||||
let Some(room) = client.client.client.get_room(&path.room_id) else {
|
||||
return Ok(HttpResponse::NotFound().json("Room not found"));
|
||||
};
|
||||
|
||||
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
|
||||
|
||||
@@ -15,9 +15,9 @@
|
||||
"@fontsource/roboto": "^5.2.10",
|
||||
"@mui/icons-material": "^7.3.8",
|
||||
"@mui/material": "^7.3.8",
|
||||
"@mui/x-data-grid": "^8.27.3",
|
||||
"@mui/x-data-grid": "^8.27.4",
|
||||
"@mui/x-date-pickers": "^8.27.2",
|
||||
"date-and-time": "^4.3.0",
|
||||
"date-and-time": "^4.3.1",
|
||||
"dayjs": "^1.11.19",
|
||||
"emoji-picker-react": "^4.18.0",
|
||||
"filesize": "^11.0.13",
|
||||
@@ -31,11 +31,11 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^10.0.1",
|
||||
"@types/node": "^25.3.3",
|
||||
"@types/node": "^25.3.5",
|
||||
"@types/react": "^19.2.14",
|
||||
"@types/react-dom": "^19.2.3",
|
||||
"@vitejs/plugin-react": "^5.1.4",
|
||||
"eslint": "^9.39.3",
|
||||
"eslint": "^9.39.4",
|
||||
"eslint-plugin-react-hooks": "^7.0.1",
|
||||
"eslint-plugin-react-refresh": "^0.5.2",
|
||||
"globals": "^17.4.0",
|
||||
|
||||
Reference in New Issue
Block a user