From 090b3b18d0565d1378a3fbfeb583fcca3692a21f Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Fri, 11 Dec 2020 14:25:56 +0100 Subject: [PATCH] =?UTF-8?q?don=E2=80=99t=20check=20for=20inRoster=20when?= =?UTF-8?q?=20doing=20jingle=20with=20oneself.=20fixes=20#3947?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/eu/siacs/conversations/ui/XmppActivity.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/ui/XmppActivity.java b/src/main/java/eu/siacs/conversations/ui/XmppActivity.java index fcdccb9c4..e143cee3d 100644 --- a/src/main/java/eu/siacs/conversations/ui/XmppActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/XmppActivity.java @@ -368,12 +368,13 @@ public abstract class XmppActivity extends ActionBarActivity { public void selectPresence(final Conversation conversation, final PresenceSelector.OnPresenceSelected listener) { final Contact contact = conversation.getContact(); - if (!contact.showInRoster()) { - showAddToRosterDialog(conversation.getContact()); - } else { + if (contact.showInRoster() || contact.isSelf()) { final Presences presences = contact.getPresences(); if (presences.size() == 0) { - if (!contact.getOption(Contact.Options.TO) + if (contact.isSelf()) { + conversation.setNextCounterpart(null); + listener.onPresenceSelected(); + } else if (!contact.getOption(Contact.Options.TO) && !contact.getOption(Contact.Options.ASKING) && contact.getAccount().getStatus() == Account.State.ONLINE) { showAskForPresenceDialog(contact); @@ -391,6 +392,8 @@ public abstract class XmppActivity extends ActionBarActivity { } else { PresenceSelector.showPresenceSelectionDialog(this, conversation, listener); } + } else { + showAddToRosterDialog(conversation.getContact()); } }