Use the stored avatar thumbnail as a fallback for other accounts

Add an optional thumbnail to `MatrixUser` and `AvatarData`, filled from the session
database for the other accounts in the room list header, the settings and the account
selection screen. `ImageAvatar` renders this thumbnail instead of the initial letter while
the avatar is loading or when it fails to load, for instance when the homeserver of the
current account is not federated with the one of the other account.

Fixes #5571

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Benoit Marty
2026-09-28 11:38:45 +02:00
parent db23023eda
commit c2a2e16f46
12 changed files with 100 additions and 3 deletions
@@ -34,6 +34,7 @@ class AccountSelectPresenter(
userId = UserId(it.userId),
displayName = it.userDisplayName,
avatarUrl = it.userAvatarUrl,
avatarThumbnail = it.userAvatarData,
)
}
.toImmutableList()
@@ -44,6 +44,7 @@ class AccountSelectPresenterTest {
sessionId = A_SESSION_ID_2.value,
userDisplayName = "Bob",
userAvatarUrl = "avatarUrl",
userAvatarData = "avatarData",
),
)
)
@@ -66,6 +67,7 @@ class AccountSelectPresenterTest {
userId = A_SESSION_ID_2,
displayName = "Bob",
avatarUrl = "avatarUrl",
avatarThumbnail = "avatarData",
)
)
}