diff --git a/lib/src/room.dart b/lib/src/room.dart index 5865fec2..0ed156ce 100644 --- a/lib/src/room.dart +++ b/lib/src/room.dart @@ -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 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; diff --git a/test/room_test.dart b/test/room_test.dart index 8fe18f5a..98bf0bb7 100644 --- a/test/room_test.dart +++ b/test/room_test.dart @@ -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(