mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 21:32:34 +00:00
RoomList: add avatar for rooms and date formatting
This commit is contained in:
@@ -96,10 +96,21 @@ class MatrixClient internal constructor(
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun loadMediaContentForSource(source: MediaSource): Result<List<UByte>> =
|
||||
suspend fun loadMediaContentForSource(source: MediaSource): Result<ByteArray> =
|
||||
withContext(dispatchers.io) {
|
||||
runCatching {
|
||||
client.getMediaContent(source)
|
||||
client.getMediaContent(source).toUByteArray().toByteArray()
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun loadMediaThumbnailForSource(
|
||||
source: MediaSource,
|
||||
width: Long,
|
||||
height: Long
|
||||
): Result<ByteArray> =
|
||||
withContext(dispatchers.io) {
|
||||
runCatching {
|
||||
client.getMediaThumbnail(source, width.toULong(), height.toULong()).toUByteArray().toByteArray()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,5 +23,5 @@ data class RoomSummaryDetails(
|
||||
val avatarURLString: String?,
|
||||
val lastMessage: CharSequence?,
|
||||
val lastMessageTimestamp: Long?,
|
||||
val unreadNotificationCount: UInt,
|
||||
val unreadNotificationCount: Int,
|
||||
)
|
||||
|
||||
+1
-1
@@ -126,7 +126,7 @@ internal class RustRoomSummaryDataSource(
|
||||
name = room.name() ?: identifier,
|
||||
isDirect = room.isDm() ?: false,
|
||||
avatarURLString = room.fullRoom()?.avatarUrl(),
|
||||
unreadNotificationCount = room.unreadNotifications().notificationCount(),
|
||||
unreadNotificationCount = room.unreadNotifications().notificationCount().toInt(),
|
||||
lastMessage = latestRoomMessage?.body,
|
||||
lastMessageTimestamp = latestRoomMessage?.originServerTs
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user