diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java index a7dc6715d..7519254bb 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java @@ -1256,7 +1256,7 @@ public class ConversationFragment extends XmppFragment if (conversation != null) { if (conversation.getMode() == Conversation.MODE_MULTI) { menuContactDetails.setVisible(false); - menuInviteContact.setVisible(conversation.getMucOptions().canInvite()); + menuInviteContact.setVisible(conversation.getMucOptions().canInvite() && conversation.getNextCounterpart() == null); menuMucDetails.setTitle( conversation.getMucOptions().isPrivateAndNonAnonymous() ? R.string.action_muc_details @@ -2410,7 +2410,9 @@ public class ConversationFragment extends XmppFragment public void privateMessageWith(final Jid counterpart) { Conversation c = activity.xmppConnectionService.findOrCreateConversation(conversation.getAccount(), conversation.getJid(), null, true, true, false, counterpart); - activity.switchToConversation(c); + if (c != conversation) { + activity.switchToConversation(c); + } } private void correctMessage(Message message) { diff --git a/src/main/java/eu/siacs/conversations/ui/XmppActivity.java b/src/main/java/eu/siacs/conversations/ui/XmppActivity.java index 27a9fb672..80b96f825 100644 --- a/src/main/java/eu/siacs/conversations/ui/XmppActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/XmppActivity.java @@ -561,7 +561,8 @@ public abstract class XmppActivity extends ActionBarActivity { } public void privateMsgInMuc(Conversation conversation, String nick) { - switchToConversation(conversation, null, false, nick, true, false); + Conversation c = xmppConnectionService.findOrCreateConversation(conversation.getAccount(), conversation.getJid(), null, true, true, false, conversation.getJid().withResource(nick)); + switchToConversation(c, null, false, nick, true, false); } public void switchToConversation(Conversation conversation, String text, boolean asQuote, String nick, boolean pm, boolean doNotAppend) { 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 404630a3d..19eb89469 100644 --- a/src/main/java/eu/siacs/conversations/ui/util/MucDetailsContextMenuHelper.java +++ b/src/main/java/eu/siacs/conversations/ui/util/MucDetailsContextMenuHelper.java @@ -120,8 +120,7 @@ public final class MucDetailsContextMenuHelper { } } managePermissions.setVisible(managePermissionsVisible); - sendPrivateMessage.setVisible(true); - sendPrivateMessage.setEnabled(true); + sendPrivateMessage.setVisible(!isGroupChat && mucOptions.allowPm() && user.getRole().ranks(MucOptions.Role.VISITOR)); } else { sendPrivateMessage.setVisible(true); sendPrivateMessage.setEnabled(user != null && mucOptions.allowPm() && user.getRole().ranks(MucOptions.Role.VISITOR));