fix: only show notifications for messages

next
timokoesters 2020-05-31 19:40:01 +02:00
parent 3aa0c8ed25
commit b519bc6962
No known key found for this signature in database
GPG Key ID: 24DA7517711A2BA4
1 changed files with 9 additions and 2 deletions

View File

@ -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 {