Merge branch 'krille/has-new-messages' into 'main'
feat: Add hasNewMessages flag to room See merge request famedly/company/frontend/famedlysdk!959
This commit is contained in:
commit
f8cea9e82b
|
|
@ -1,3 +1,7 @@
|
||||||
|
## [0.8.6] - 14nd Feb 2022
|
||||||
|
- feat: Add hasNewMessages flag to room
|
||||||
|
- fix: Sort rooms after updating the UI on web
|
||||||
|
|
||||||
## [0.8.5] - 14nd Feb 2022
|
## [0.8.5] - 14nd Feb 2022
|
||||||
- fix: exception on removed widgets
|
- fix: exception on removed widgets
|
||||||
- fix: Fix black screen when end screensharing with system buttons.
|
- fix: Fix black screen when end screensharing with system buttons.
|
||||||
|
|
|
||||||
|
|
@ -511,7 +511,16 @@ class Room {
|
||||||
.unread;
|
.unread;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns true if this room is unread
|
/// Checks if the last event has a read marker of the user.
|
||||||
|
bool get hasNewMessages {
|
||||||
|
final lastEvent = this.lastEvent;
|
||||||
|
return lastEvent != null &&
|
||||||
|
!lastEvent.receipts
|
||||||
|
.any((receipt) => receipt.user.senderId == client.userID!);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Returns true if this room is unread. To check if there are new messages
|
||||||
|
/// in muted rooms, use [hasNewMessages].
|
||||||
bool get isUnread => notificationCount > 0 || markedUnread;
|
bool get isUnread => notificationCount > 0 || markedUnread;
|
||||||
|
|
||||||
@Deprecated('Use [markUnread] instead')
|
@Deprecated('Use [markUnread] instead')
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
name: matrix
|
name: matrix
|
||||||
description: Matrix Dart SDK
|
description: Matrix Dart SDK
|
||||||
version: 0.8.5
|
version: 0.8.6
|
||||||
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
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue