From b519bc696257d082c7e84b95a31ce03063d13261 Mon Sep 17 00:00:00 2001 From: timokoesters Date: Sun, 31 May 2020 19:40:01 +0200 Subject: [PATCH] fix: only show notifications for messages --- src/client_server.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/client_server.rs b/src/client_server.rs index 150555c..3635bf3 100644 --- a/src/client_server.rs +++ b/src/client_server.rs @@ -2003,7 +2003,14 @@ pub fn sync_route( let notification_count = if let Some(last_read) = db.rooms.edus.room_read_get(&room_id, &user_id).unwrap() { - Some((db.rooms.pdus_since(&room_id, last_read).unwrap().count() as u32).into()) + Some( + (db.rooms + .pdus_since(&room_id, last_read) + .unwrap() + .filter(|pdu| matches!(pdu.as_ref().unwrap().kind.clone(), EventType::RoomMessage | EventType::RoomEncrypted)) + .count() as u32) + .into(), + ) } else { None }; @@ -2079,7 +2086,7 @@ pub fn sync_route( }, }, unread_notifications: sync_events::UnreadNotificationsCount { - highlight_count: notification_count, + highlight_count: None, notification_count, }, timeline: sync_events::Timeline {