matrix: wake and unread-guard on own read receipt, not push-rule count

This commit is contained in:
damocles 2026-08-03 13:18:15 +02:00 committed by mara
commit 1192c4e4c7
2 changed files with 105 additions and 81 deletions

View file

@ -27,10 +27,14 @@ pub enum InviteAction {
pub struct RoomUnread {
/// Canonical alias (`#name:server`) or room id (`!id:server`).
pub label: String,
/// Server-side push-notification count for this room. Always ≥ 1.
/// Always `1` — an exact unread-message count is no longer tracked
/// (see `handlers::room_unread_state`'s doc comment for why); the
/// agent reads the room via `read_room` for full context, so only
/// "there's something new" plus a one-message preview matters here.
pub count: u32,
/// Truncated body of the last message in the room. Present only when
/// `count == 1` and the fetch succeeded; absent otherwise.
/// Truncated body of the room's latest (unread) event. Present when
/// that event is a text-like message; absent for a reaction/state
/// event or when the fetch failed.
#[serde(skip_serializing_if = "Option::is_none")]
pub last_body: Option<String>,
/// Sender of the last message (`@user:server`). Present when