don’t check for inRoster when doing jingle with oneself. fixes #3947

This commit is contained in:
Daniel Gultsch 2020-12-11 14:25:56 +01:00
parent d1490673bb
commit 090b3b18d0
1 changed files with 7 additions and 4 deletions

View File

@ -368,12 +368,13 @@ public abstract class XmppActivity extends ActionBarActivity {
public void selectPresence(final Conversation conversation, final PresenceSelector.OnPresenceSelected listener) { public void selectPresence(final Conversation conversation, final PresenceSelector.OnPresenceSelected listener) {
final Contact contact = conversation.getContact(); final Contact contact = conversation.getContact();
if (!contact.showInRoster()) { if (contact.showInRoster() || contact.isSelf()) {
showAddToRosterDialog(conversation.getContact());
} else {
final Presences presences = contact.getPresences(); final Presences presences = contact.getPresences();
if (presences.size() == 0) { 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.getOption(Contact.Options.ASKING)
&& contact.getAccount().getStatus() == Account.State.ONLINE) { && contact.getAccount().getStatus() == Account.State.ONLINE) {
showAskForPresenceDialog(contact); showAskForPresenceDialog(contact);
@ -391,6 +392,8 @@ public abstract class XmppActivity extends ActionBarActivity {
} else { } else {
PresenceSelector.showPresenceSelectionDialog(this, conversation, listener); PresenceSelector.showPresenceSelectionDialog(this, conversation, listener);
} }
} else {
showAddToRosterDialog(conversation.getContact());
} }
} }