From b84724409faa6c9173f2ed4121d104d6dab3cbb2 Mon Sep 17 00:00:00 2001 From: Niels Andriesse Date: Thu, 6 Feb 2020 11:58:30 +1100 Subject: [PATCH] Fix Session Public Chat profile picture --- .../loki/redesign/views/ConversationView.kt | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/org/thoughtcrime/securesms/loki/redesign/views/ConversationView.kt b/src/org/thoughtcrime/securesms/loki/redesign/views/ConversationView.kt index c34a111ce9..1c158781bb 100644 --- a/src/org/thoughtcrime/securesms/loki/redesign/views/ConversationView.kt +++ b/src/org/thoughtcrime/securesms/loki/redesign/views/ConversationView.kt @@ -49,11 +49,16 @@ class ConversationView : LinearLayout { populateUserHexEncodedPublicKeyCacheIfNeeded(thread.threadId, context) // FIXME: This is a terrible place to do this unreadMessagesIndicatorView.visibility = if (thread.unreadCount > 0) View.VISIBLE else View.INVISIBLE if (thread.recipient.isGroupRecipient) { - val users = LokiAPI.userHexEncodedPublicKeyCache[thread.threadId]?.toList() ?: listOf() - val randomUsers = users.sorted() // Sort to provide a level of stability - profilePictureView.hexEncodedPublicKey = randomUsers.getOrNull(0) ?: "" - profilePictureView.additionalHexEncodedPublicKey = randomUsers.getOrNull(1) ?: "" - profilePictureView.isRSSFeed = thread.recipient.name == "Loki News" || thread.recipient.name == "Session Updates" + if ("Session Public Chat" == thread.recipient.name) { + profilePictureView.hexEncodedPublicKey = "" + profilePictureView.isRSSFeed = true + } else { + val users = LokiAPI.userHexEncodedPublicKeyCache[thread.threadId]?.toList() ?: listOf() + val randomUsers = users.sorted() // Sort to provide a level of stability + profilePictureView.hexEncodedPublicKey = randomUsers.getOrNull(0) ?: "" + profilePictureView.additionalHexEncodedPublicKey = randomUsers.getOrNull(1) ?: "" + profilePictureView.isRSSFeed = thread.recipient.name == "Loki News" || thread.recipient.name == "Session Updates" + } } else { profilePictureView.hexEncodedPublicKey = thread.recipient.address.toString() profilePictureView.additionalHexEncodedPublicKey = null