diff options
author | Christian Schneppe <christian.schneppe@pix-art.de> | 2019-10-26 19:06:50 +0200 |
---|---|---|
committer | Christian Schneppe <christian.schneppe@pix-art.de> | 2019-10-26 19:06:50 +0200 |
commit | 1076c25767f4ba2e0b3728980ad77dbc73d9bc65 (patch) | |
tree | f9028e9cde5770eef17003cfee46da1fcf3534ff /src/main | |
parent | ac865873239c8666e70cc3680f4168479dce8e1d (diff) |
always show 'contact details' on avatar long press in non-anon
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/util/MucDetailsContextMenuHelper.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/util/MucDetailsContextMenuHelper.java b/src/main/java/de/pixart/messenger/ui/util/MucDetailsContextMenuHelper.java index 5a6415d75..9a785b0a7 100644 --- a/src/main/java/de/pixart/messenger/ui/util/MucDetailsContextMenuHelper.java +++ b/src/main/java/de/pixart/messenger/ui/util/MucDetailsContextMenuHelper.java @@ -19,6 +19,7 @@ import androidx.appcompat.app.AlertDialog; import de.pixart.messenger.Config; import de.pixart.messenger.R; +import de.pixart.messenger.entities.Account; import de.pixart.messenger.entities.Contact; import de.pixart.messenger.entities.Conversation; import de.pixart.messenger.entities.MucOptions; @@ -94,8 +95,8 @@ public final class MucDetailsContextMenuHelper { startConversation.setVisible(true); final Contact contact = user.getContact(); final User self = conversation.getMucOptions().getSelf(); - if (contact != null && contact.showInRoster()) { - showContactDetails.setVisible(!contact.isSelf()); + if ((contact != null && contact.showInRoster()) || mucOptions.isPrivateAndNonAnonymous()) { + showContactDetails.setVisible(contact == null || !contact.isSelf()); } if ((activity instanceof ConferenceDetailsActivity || activity instanceof MucUsersActivity) && user.getRole() == MucOptions.Role.NONE) { invite.setVisible(true); @@ -164,7 +165,9 @@ public final class MucDetailsContextMenuHelper { Jid jid = user.getRealJid(); switch (item.getItemId()) { case R.id.action_contact_details: - Contact contact = user.getContact(); + final Jid realJid = user.getRealJid(); + final Account account = conversation.getAccount(); + final Contact contact = realJid == null ? null : account.getRoster().getContact(realJid); if (contact != null) { activity.switchToContactDetails(contact, fingerprint); } |