From 88dfceed6717ee1c8113610c23c3625a63785102 Mon Sep 17 00:00:00 2001 From: Andrew Date: Sun, 18 Feb 2024 02:22:02 +1030 Subject: [PATCH] Cleanup ConversationViewModel --- .../securesms/conversation/v2/ConversationViewModel.kt | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationViewModel.kt b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationViewModel.kt index 00b1b98f6a..677dd22f60 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationViewModel.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationViewModel.kt @@ -221,14 +221,12 @@ class ConversationViewModel( } fun hidesInputBar(): Boolean = openGroup?.canWrite != true && - blindedRecipient?.blocksCommunityMessageRequests == true + blindedRecipient?.blocksCommunityMessageRequests == true - fun legacyBannerRecipient(context: Context): Recipient? = recipient?.let { recipient -> - val legacyAddress = storage.getLastLegacyRecipient(recipient.address.serialize()) ?: return@let null - return Recipient.from(context, Address.fromSerialized(legacyAddress), false) + fun legacyBannerRecipient(context: Context): Recipient? = recipient?.run { + storage.getLastLegacyRecipient(address.serialize())?.let { Recipient.from(context, Address.fromSerialized(it), false) } } - @dagger.assisted.AssistedFactory interface AssistedFactory { fun create(threadId: Long, edKeyPair: KeyPair?): Factory