mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 12:07:28 +00:00
Only show a Matrix ID in the room picker for a direct message
heroes is populated for any room whose name is derived from its members, not only for direct messages, so a two person room that is not a DM showed a member's Matrix ID as its subtitle. Carry isDm on SelectRoomInfo and read the hero only when it is set. The canonical alias still takes precedence, so nothing changes for a room that has one.
This commit is contained in:
+2
@@ -31,6 +31,7 @@ fun aSelectRoomInfo(
|
||||
canonicalAlias: RoomAlias? = null,
|
||||
avatarUrl: String? = null,
|
||||
heroes: ImmutableList<MatrixUser> = persistentListOf(),
|
||||
isDm: Boolean = false,
|
||||
isTombstoned: Boolean = false,
|
||||
) = SelectRoomInfo(
|
||||
roomId = roomId,
|
||||
@@ -38,5 +39,6 @@ fun aSelectRoomInfo(
|
||||
canonicalAlias = canonicalAlias,
|
||||
avatarUrl = avatarUrl,
|
||||
heroes = heroes,
|
||||
isDm = isDm,
|
||||
isTombstoned = isTombstoned,
|
||||
)
|
||||
|
||||
+2
@@ -23,6 +23,7 @@ data class SelectRoomInfo(
|
||||
val canonicalAlias: RoomAlias?,
|
||||
val avatarUrl: String?,
|
||||
val heroes: ImmutableList<MatrixUser>,
|
||||
val isDm: Boolean,
|
||||
val isTombstoned: Boolean,
|
||||
) {
|
||||
fun getAvatarData(size: AvatarSize) = AvatarData(
|
||||
@@ -41,5 +42,6 @@ fun RoomInfo.toSelectRoomInfo() = SelectRoomInfo(
|
||||
avatarUrl = avatarUrl,
|
||||
heroes = heroes,
|
||||
canonicalAlias = canonicalAlias,
|
||||
isDm = isDm,
|
||||
isTombstoned = successorRoom != null,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user