do not show 'delete contact' for phone contacts. do not treat as stranger

This commit is contained in:
Daniel Gultsch 2018-08-31 11:04:45 +02:00
parent b565c20d91
commit 201d8ab398
2 changed files with 3 additions and 0 deletions

View File

@ -931,6 +931,7 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl
&& !contact.isOwnServer() && !contact.isOwnServer()
&& !contact.showInRoster() && !contact.showInRoster()
&& !contact.isSelf() && !contact.isSelf()
&& !contact.showInPhoneBook()
&& sentMessagesCount() == 0; && sentMessagesCount() == 0;
} }

View File

@ -1050,9 +1050,11 @@ public class StartConversationActivity extends XmppActivity implements XmppConne
final Contact contact = (Contact) activity.contacts.get(acmi.position); final Contact contact = (Contact) activity.contacts.get(acmi.position);
final MenuItem blockUnblockItem = menu.findItem(R.id.context_contact_block_unblock); final MenuItem blockUnblockItem = menu.findItem(R.id.context_contact_block_unblock);
final MenuItem showContactDetailsItem = menu.findItem(R.id.context_contact_details); final MenuItem showContactDetailsItem = menu.findItem(R.id.context_contact_details);
final MenuItem deleteContactMenuItem = menu.findItem(R.id.context_delete_contact);
if (contact.isSelf()) { if (contact.isSelf()) {
showContactDetailsItem.setVisible(false); showContactDetailsItem.setVisible(false);
} }
deleteContactMenuItem.setVisible(contact.showInRoster());
XmppConnection xmpp = contact.getAccount().getXmppConnection(); XmppConnection xmpp = contact.getAccount().getXmppConnection();
if (xmpp != null && xmpp.getFeatures().blocking() && !contact.isSelf()) { if (xmpp != null && xmpp.getFeatures().blocking() && !contact.isSelf()) {
if (contact.isBlocked()) { if (contact.isBlocked()) {