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
This commit is contained in:
Greyson Parrelli 2018-09-16 22:48:57 -07:00
parent 5d11e321a8
commit 1d4020ffc6

View File

@ -242,6 +242,7 @@ public class ConversationFragment extends Fragment
Set<MessageRecord> 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() &&