From 772529b7b59ef430899a84260928319cadcdfddc Mon Sep 17 00:00:00 2001 From: damocles Date: Mon, 3 Aug 2026 14:43:14 +0200 Subject: [PATCH] matrix: drop dead unread_count handler --- hive-matrix-mcp/src/handlers.rs | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/hive-matrix-mcp/src/handlers.rs b/hive-matrix-mcp/src/handlers.rs index facefb5b..7f03a87e 100644 --- a/hive-matrix-mcp/src/handlers.rs +++ b/hive-matrix-mcp/src/handlers.rs @@ -901,28 +901,6 @@ pub async fn download_file( })) } -/// Return the number of joined rooms with at least one unread -/// notification according to the server-side push notification counts -/// cached by the matrix-sdk client. -/// -/// The harness uses [`unread_summary`] (richer, with per-room body -/// snippets) rather than this endpoint. `unread_count` is kept as a -/// lightweight public endpoint for callers that only need the count -/// and want to avoid the `/messages` network round-trips that -/// [`collect_unread`] issues for count==1 rooms. -#[must_use] -pub fn unread_count(client: &Client) -> DaemonResponse { - let rooms = u32::try_from( - client - .joined_rooms() - .into_iter() - .filter(|r| r.unread_notification_counts().notification_count > 0) - .count(), - ) - .unwrap_or(u32::MAX); - DaemonResponse::ok(&serde_json::json!({ "rooms": rooms })) -} - /// Collect all rooms with unread notifications and build per-room /// [`crate::protocol::RoomUnread`] entries. For rooms with exactly /// one unread notification the last message body is fetched via the