separate PM fixes

This commit is contained in:
kosyak 2023-09-15 14:11:43 +02:00
parent 1ca354c208
commit 6770f7de61
3 changed files with 7 additions and 5 deletions

View file

@ -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) {

View file

@ -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) {

View file

@ -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));