From 8f812d9ceb5e3b839d9455e4ce8add4f846c9309 Mon Sep 17 00:00:00 2001 From: nielsandriesse Date: Wed, 16 Sep 2020 09:52:22 +1000 Subject: [PATCH] Show current user in compound profile picture if needed --- .../thoughtcrime/securesms/loki/views/ProfilePictureView.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/org/thoughtcrime/securesms/loki/views/ProfilePictureView.kt b/src/org/thoughtcrime/securesms/loki/views/ProfilePictureView.kt index 9a7b9f0c11..6331d4ff10 100644 --- a/src/org/thoughtcrime/securesms/loki/views/ProfilePictureView.kt +++ b/src/org/thoughtcrime/securesms/loki/views/ProfilePictureView.kt @@ -81,7 +81,11 @@ class ProfilePictureView : RelativeLayout { if (masterPublicKey != null) { users.remove(masterPublicKey) } - val randomUsers = users.sorted() // Sort to provide a level of stability + val randomUsers = users.sorted().toMutableList() // Sort to provide a level of stability + if (users.count() == 1) { + val userPublicKey = TextSecurePreferences.getLocalNumber(context) + randomUsers.add(0, userPublicKey) // Ensure the current user is at the back visually + } val pk = randomUsers.getOrNull(0) ?: "" publicKey = pk displayName = getUserDisplayName(pk)