mirror of
https://gitlab.com/famedly/conduit.git
synced 2024-12-27 15:14:29 +01:00
fix: only show notifications for messages
This commit is contained in:
parent
3aa0c8ed25
commit
b519bc6962
1 changed files with 9 additions and 2 deletions
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue