make presence selector work with empty resources (bare jid)
This commit is contained in:
parent
0dba9f560c
commit
fda9e7b51c
File diff suppressed because it is too large
Load Diff
|
@ -106,12 +106,21 @@ public class PresenceSelector {
|
||||||
builder.setPositiveButton(
|
builder.setPositiveButton(
|
||||||
R.string.ok,
|
R.string.ok,
|
||||||
(dialog, which) -> onFullJidSelected.onFullJidSelected(
|
(dialog, which) -> onFullJidSelected.onFullJidSelected(
|
||||||
Jid.of(contact.getJid().getLocal(), contact.getJid().getDomain(), resourceArray[selectedResource.get()])
|
getNextCounterpart(contact, resourceArray[selectedResource.get()])
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
builder.create().show();
|
builder.create().show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static Jid getNextCounterpart(final Contact contact, final String resource) {
|
||||||
|
if (resource.isEmpty()) {
|
||||||
|
return contact.getJid().asBareJid();
|
||||||
|
} else {
|
||||||
|
return contact.getJid().withResource(resource);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static void warnMutualPresenceSubscription(Activity activity, final Conversation conversation, final OnPresenceSelected listener) {
|
public static void warnMutualPresenceSubscription(Activity activity, final Conversation conversation, final OnPresenceSelected listener) {
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
|
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
|
||||||
builder.setTitle(conversation.getContact().getJid().toString());
|
builder.setTitle(conversation.getContact().getJid().toString());
|
||||||
|
|
Loading…
Reference in New Issue