From 41ab9b98f820afc0435013683c475be613116b48 Mon Sep 17 00:00:00 2001 From: ThomasSession Date: Fri, 2 Aug 2024 16:00:24 +1000 Subject: [PATCH] Updated logic for hiding the input in conversation --- .../securesms/conversation/v2/ConversationViewModel.kt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 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 cbae0e757f..b0a541a9e8 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 @@ -261,8 +261,14 @@ class ConversationViewModel( _recipient.updateTo(repository.maybeGetRecipientForThreadId(threadId)) } - fun hidesInputBar(): Boolean = openGroup?.canWrite != true && - blindedRecipient?.blocksCommunityMessageRequests == true + /** + * The input should be hidden when: + * - We are in a community without write access + * - We are dealing with a contact from a community (blinded recipient) that does not allow + * requests form community members + */ + fun hidesInputBar(): Boolean = openGroup?.canWrite == false || + blindedRecipient?.blocksCommunityMessageRequests == true fun legacyBannerRecipient(context: Context): Recipient? = recipient?.run { storage.getLastLegacyRecipient(address.serialize())?.let { Recipient.from(context, Address.fromSerialized(it), false) }