From d8fc03b2f7e6573e7a73ab42dbb8775394ebdba7 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Sat, 3 Nov 2018 17:07:02 +0100 Subject: [PATCH] show 'send pm' button in anon chats. fixes #3257 --- .../conversations/ui/util/MucDetailsContextMenuHelper.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/ui/util/MucDetailsContextMenuHelper.java b/src/main/java/eu/siacs/conversations/ui/util/MucDetailsContextMenuHelper.java index 0c57e0b7b..85e1d16c1 100644 --- a/src/main/java/eu/siacs/conversations/ui/util/MucDetailsContextMenuHelper.java +++ b/src/main/java/eu/siacs/conversations/ui/util/MucDetailsContextMenuHelper.java @@ -26,7 +26,9 @@ import rocks.xmpp.addr.Jid; public final class MucDetailsContextMenuHelper { public static void configureMucDetailsContextMenu(Activity activity, Menu menu, Conversation conversation, User user) { + final MucOptions mucOptions = conversation.getMucOptions(); final boolean advancedMode = PreferenceManager.getDefaultSharedPreferences(activity).getBoolean("advanced_muc_mode", false); + MenuItem sendPrivateMessage = menu.findItem(R.id.send_private_message); if (user != null && user.getRealJid() != null) { MenuItem showContactDetails = menu.findItem(R.id.action_contact_details); MenuItem startConversation = menu.findItem(R.id.start_conversation); @@ -68,9 +70,8 @@ public final class MucDetailsContextMenuHelper { removeAdminPrivileges.setVisible(true); } } + sendPrivateMessage.setVisible(!mucOptions.isPrivateAndNonAnonymous() && mucOptions.allowPm() && user.getRole().ranks(MucOptions.Role.VISITOR)); } else { - final MucOptions mucOptions = conversation.getMucOptions(); - MenuItem sendPrivateMessage = menu.findItem(R.id.send_private_message); sendPrivateMessage.setVisible(true); sendPrivateMessage.setEnabled(user != null && mucOptions.allowPm() && user.getRole().ranks(MucOptions.Role.VISITOR)); }