diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationOptionsMenu.kt b/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationOptionsMenu.kt index a0d3f7f2c1c..7dd66201614 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationOptionsMenu.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationOptionsMenu.kt @@ -55,7 +55,8 @@ internal object ConversationOptionsMenu { distributionType, threadId, messageRequestState, - isInBubble + isInBubble, + isSingleMember ) = callback.getSnapshot() if (recipient == null) { @@ -181,6 +182,13 @@ internal object ConversationOptionsMenu { } }) + lifecycleDisposable += isSingleMember.subscribeBy(onNext = { yes: Boolean -> + val item = menu.findItem(R.id.menu_video_secure) + if(item != null) { + item.isVisible = item.isVisible && yes + } + }) + menu.findItem(R.id.menu_format_text_submenu).subMenu?.clearHeader() menu.findItem(R.id.edittext_bold).applyTitleSpan(MessageStyler.boldStyle()) menu.findItem(R.id.edittext_italic).applyTitleSpan(MessageStyler.italicStyle()) @@ -258,7 +266,8 @@ internal object ConversationOptionsMenu { val distributionType: Int, val threadId: Long, val messageRequestState: MessageRequestState, - val isInBubble: Boolean + val isInBubble: Boolean, + val isSingleMember: Observable, ) /** diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationFragment.kt b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationFragment.kt index 5606abad743..aacd23936a0 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationFragment.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationFragment.kt @@ -3336,7 +3336,8 @@ class ConversationFragment : distributionType = args.distributionType, threadId = args.threadId, messageRequestState = viewModel.messageRequestState, - isInBubble = args.conversationScreenType.isInBubble + isInBubble = args.conversationScreenType.isInBubble, + isSingleMember = viewModel.isSingleMember() ) } 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 197a6f7ca4f..838a7e493a6 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 @@ -540,6 +540,12 @@ class ConversationViewModel( .observeOn(AndroidSchedulers.mainThread()) } + fun isSingleMember() : Observable { + return groupMemberServiceIds + .map { it.isEmpty() } + .observeOn(AndroidSchedulers.mainThread()) + } + fun copyToClipboard(context: Context, messageParts: Set): Maybe { return repository.copyToClipboard(context, messageParts) }