Merge branch 'braid/hightlighted-rooms' into 'main'

feat: introduce hightlighted room getter

See merge request famedly/company/frontend/famedlysdk!1152
This commit is contained in:
The one with the braid 2022-10-26 10:01:04 +00:00
commit cf2104c12e
2 changed files with 7 additions and 1 deletions

View File

@ -530,6 +530,10 @@ class Room {
/// in muted rooms, use [hasNewMessages].
bool get isUnread => notificationCount > 0 || markedUnread;
/// Returns true if this room is to be marked as unread. This extends
/// [isUnread] to rooms with [Membership.invite].
bool get isUnreadOrInvited => isUnread || membership == Membership.invite;
@Deprecated('Use waitForRoomInSync() instead')
Future<SyncUpdate> get waitForSync => waitForRoomInSync();
@ -1689,6 +1693,7 @@ class Room {
bool get canCreateGroupCall =>
canChangeStateEvent('org.matrix.msc3401.call') && groupCallsEnabled;
bool get canJoinGroupCall =>
canChangeStateEvent('org.matrix.msc3401.call.member') &&
groupCallsEnabled;

View File

@ -189,7 +189,8 @@ void main() {
stateKey: '',
),
);
expect(room.hasNewMessages, true);
expect(room.hasNewMessages, isTrue);
expect(room.isUnreadOrInvited, isTrue);
expect(room.lastEvent?.body, 'cd');
room.setState(
Event(