From 1d4020ffc6e529cdbd2b71f5d5af206bb3200756 Mon Sep 17 00:00:00 2001 From: Greyson Parrelli Date: Sun, 16 Sep 2018 22:48:57 -0700 Subject: [PATCH] Disable forwarding for shared contacts. Forwarding of shared contacts currently just creates an empty draft. You can't preview a shared contact before you send, which would make the forwarding flow inconsistent across media types. So it's easier to just hide it for now. Fixes #8195 --- src/org/thoughtcrime/securesms/ConversationFragment.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/org/thoughtcrime/securesms/ConversationFragment.java b/src/org/thoughtcrime/securesms/ConversationFragment.java index 4c5069f488..13b5122154 100644 --- a/src/org/thoughtcrime/securesms/ConversationFragment.java +++ b/src/org/thoughtcrime/securesms/ConversationFragment.java @@ -242,6 +242,7 @@ public class ConversationFragment extends Fragment Set messageRecords = getListAdapter().getSelectedItems(); boolean actionMessage = false; boolean hasText = false; + boolean sharedContact = false; if (actionMode != null && messageRecords.size() == 0) { actionMode.finish(); @@ -256,11 +257,13 @@ public class ConversationFragment extends Fragment { actionMessage = true; } + if (messageRecord.getBody().length() > 0) { hasText = true; } - if (actionMessage && hasText) { - break; + + if (messageRecord.isMms() && !((MmsMessageRecord) messageRecord).getSharedContacts().isEmpty()) { + sharedContact = true; } } @@ -279,7 +282,7 @@ public class ConversationFragment extends Fragment !messageRecord.isMmsNotification() && ((MediaMmsMessageRecord)messageRecord).containsMediaSlide()); - menu.findItem(R.id.menu_context_forward).setVisible(!actionMessage); + menu.findItem(R.id.menu_context_forward).setVisible(!actionMessage && !sharedContact); menu.findItem(R.id.menu_context_details).setVisible(!actionMessage); menu.findItem(R.id.menu_context_reply).setVisible(!actionMessage && !messageRecord.isPending() &&