diff --git a/lib/src/client.dart b/lib/src/client.dart index 32fe2cd7..cb167b0c 100644 --- a/lib/src/client.dart +++ b/lib/src/client.dart @@ -160,6 +160,7 @@ class Client extends MatrixApi { this.importantStateEvents, this.roomPreviewLastEvents, this.pinUnreadRooms = false, + this.pinInvitedRooms = true, this.sendMessageTimeoutSeconds = 60, this.requestHistoryOnLimitedTimeline = false, this.supportedLoginTypes, @@ -1576,6 +1577,9 @@ sort order of ${prevState.sortOrder}. This should never happen...'''); /// If `true` then unread rooms are pinned at the top of the room list. bool pinUnreadRooms; + /// If `true` then unread rooms are pinned at the top of the room list. + bool pinInvitedRooms; + /// The compare function how the rooms should be sorted internally. By default /// rooms are sorted by timestamp of the last m.room.message event or the last /// event if there is no known message. diff --git a/lib/src/room.dart b/lib/src/room.dart index 8d5c0022..74bdcaa0 100644 --- a/lib/src/room.dart +++ b/lib/src/room.dart @@ -545,7 +545,9 @@ class Room { } /// Returns true if this room has a m.favourite tag. - bool get isFavourite => tags[TagType.favourite] != null; + bool get isFavourite => + tags[TagType.favourite] != null || + (client.pinInvitedRooms && membership == Membership.invite); /// Sets the m.favourite tag for this room. Future setFavourite(bool favourite) =>