Merge branch 'krille/hasnewmessage-own-last-event' into 'main'

fix: hasNewMessage true when last event is sent

See merge request famedly/company/frontend/famedlysdk!965
This commit is contained in:
Krille Fear 2022-02-16 07:18:47 +00:00
commit f967f02487
3 changed files with 11 additions and 3 deletions

View File

@ -1,4 +1,9 @@
## [0.8.8] - 14nd Feb 2022 ## [0.8.9] - 16nd Feb 2022
- feat: Return homeserver summary on checkHomeserver
- fix: hasNewMessage true when last event is sent
- fix: Correctly end the call.
## [0.8.8] - 15nd Feb 2022
- fix: Has new messages compares ts - fix: Has new messages compares ts
- fix: handle dynamic content for pinned events - fix: handle dynamic content for pinned events

View File

@ -524,12 +524,15 @@ class Room {
return false; return false;
} }
// If the last event is sent, we mark the room as read.
if (lastEvent.senderId == client.userID) return false;
// Get the timestamp of read marker and compare
final readAtMilliseconds = roomAccountData['m.receipt'] final readAtMilliseconds = roomAccountData['m.receipt']
?.content ?.content
.tryGetMap<String, dynamic>(client.userID!) .tryGetMap<String, dynamic>(client.userID!)
?.tryGet<int>('ts') ?? ?.tryGet<int>('ts') ??
0; 0;
return readAtMilliseconds < lastEvent.originServerTs.millisecondsSinceEpoch; return readAtMilliseconds < lastEvent.originServerTs.millisecondsSinceEpoch;
} }

View File

@ -1,6 +1,6 @@
name: matrix name: matrix
description: Matrix Dart SDK description: Matrix Dart SDK
version: 0.8.8 version: 0.8.9
homepage: https://famedly.com homepage: https://famedly.com
repository: https://gitlab.com/famedly/company/frontend/famedlysdk.git repository: https://gitlab.com/famedly/company/frontend/famedlysdk.git