From 338c732e5fa98bb2ed70d0e2216e2668a8a0cfbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Thu, 8 May 2025 09:42:41 +0200 Subject: [PATCH] event: Do not count unsent events as unread or as activity --- src/session/model/room/timeline/event/mod.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/session/model/room/timeline/event/mod.rs b/src/session/model/room/timeline/event/mod.rs index adec5e5f..0acdfb18 100644 --- a/src/session/model/room/timeline/event/mod.rs +++ b/src/session/model/room/timeline/event/mod.rs @@ -846,7 +846,8 @@ impl Event { /// /// [MSC2654]: https://github.com/matrix-org/matrix-spec-proposals/pull/2654 pub(crate) fn counts_as_unread(&self) -> bool { - self.item().content().counts_as_unread() + let item = self.item(); + item.is_remote_event() && item.content().counts_as_unread() } /// Whether this `Event` can count as activity in a room. @@ -855,7 +856,8 @@ impl Event { /// our own user towards joining a room, so that freshly joined rooms are at /// the top of the list. pub(crate) fn counts_as_activity(&self, own_user_id: &UserId) -> bool { - self.item().content().counts_as_activity(own_user_id) + let item = self.item(); + item.is_remote_event() && item.content().counts_as_activity(own_user_id) } /// The `matrix.to` URI representation for this event.