1
0
Fork 0
mirror of https://gitlab.com/famedly/conduit.git synced 2024-07-02 16:28:19 +02:00

fix: only show notifications for messages

This commit is contained in:
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

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 {