feat: Pin invited rooms
Invitations should always be on top of the room list. This makes it an optional parameter now which defaults to true.
This commit is contained in:
parent
efb5842959
commit
d921f38734
|
|
@ -160,6 +160,7 @@ class Client extends MatrixApi {
|
||||||
this.importantStateEvents,
|
this.importantStateEvents,
|
||||||
this.roomPreviewLastEvents,
|
this.roomPreviewLastEvents,
|
||||||
this.pinUnreadRooms = false,
|
this.pinUnreadRooms = false,
|
||||||
|
this.pinInvitedRooms = true,
|
||||||
this.sendMessageTimeoutSeconds = 60,
|
this.sendMessageTimeoutSeconds = 60,
|
||||||
this.requestHistoryOnLimitedTimeline = false,
|
this.requestHistoryOnLimitedTimeline = false,
|
||||||
this.supportedLoginTypes,
|
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.
|
/// If `true` then unread rooms are pinned at the top of the room list.
|
||||||
bool pinUnreadRooms;
|
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
|
/// 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
|
/// rooms are sorted by timestamp of the last m.room.message event or the last
|
||||||
/// event if there is no known message.
|
/// event if there is no known message.
|
||||||
|
|
|
||||||
|
|
@ -545,7 +545,9 @@ class Room {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns true if this room has a m.favourite tag.
|
/// 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.
|
/// Sets the m.favourite tag for this room.
|
||||||
Future<void> setFavourite(bool favourite) =>
|
Future<void> setFavourite(bool favourite) =>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue