3 Commits

Author SHA1 Message Date
a5ad5973b7 feat: do not return latest_event info when getting single room information by default
Some checks failed
continuous-integration/drone/push Build is failing
2026-03-10 18:14:49 +01:00
01b1434e37 Merge pull request 'chore(deps): update dependency eslint to ^9.39.4' (#200) from renovate/eslint-9.x into master
Some checks failed
continuous-integration/drone/push Build is failing
2026-03-09 00:17:01 +00:00
7a60460973 chore(deps): update dependency eslint to ^9.39.4
Some checks failed
renovate/artifacts Artifact file update failure
continuous-integration/drone/pr Build is failing
continuous-integration/drone/push Build is failing
2026-03-09 00:16:59 +00:00
2 changed files with 19 additions and 5 deletions

View File

@@ -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, &notifs).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, &notifs).await?;
if !query.with_latest_event {
room_info.latest_event = None;
}
Ok(HttpResponse::Ok().json(room_info))
}
/// Get room avatar

View File

@@ -35,7 +35,7 @@
"@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",