From 201d8ab3986df06f94953e13a84958795a9fe147 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Fri, 31 Aug 2018 11:04:45 +0200 Subject: [PATCH] do not show 'delete contact' for phone contacts. do not treat as stranger --- src/main/java/eu/siacs/conversations/entities/Conversation.java | 1 + .../eu/siacs/conversations/ui/StartConversationActivity.java | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/main/java/eu/siacs/conversations/entities/Conversation.java b/src/main/java/eu/siacs/conversations/entities/Conversation.java index e03f24693..f40ede2e9 100644 --- a/src/main/java/eu/siacs/conversations/entities/Conversation.java +++ b/src/main/java/eu/siacs/conversations/entities/Conversation.java @@ -931,6 +931,7 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl && !contact.isOwnServer() && !contact.showInRoster() && !contact.isSelf() + && !contact.showInPhoneBook() && sentMessagesCount() == 0; } diff --git a/src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java b/src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java index c4331eb96..294f690bc 100644 --- a/src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java @@ -1050,9 +1050,11 @@ public class StartConversationActivity extends XmppActivity implements XmppConne final Contact contact = (Contact) activity.contacts.get(acmi.position); final MenuItem blockUnblockItem = menu.findItem(R.id.context_contact_block_unblock); final MenuItem showContactDetailsItem = menu.findItem(R.id.context_contact_details); + final MenuItem deleteContactMenuItem = menu.findItem(R.id.context_delete_contact); if (contact.isSelf()) { showContactDetailsItem.setVisible(false); } + deleteContactMenuItem.setVisible(contact.showInRoster()); XmppConnection xmpp = contact.getAccount().getXmppConnection(); if (xmpp != null && xmpp.getFeatures().blocking() && !contact.isSelf()) { if (contact.isBlocked()) {