mirror of
https://github.com/zxing/zxing.git
synced 2024-11-09 20:44:03 -08:00
Set protocol to JABBER if XMPP IM handle is found (#1007)
IMPP field can be set to a URI [0]. If that URI is of XMPP scheme set the protocol used to JABBER and drop the scheme part from the IM handle. This format is used by XMPP messengers e.g. Conversations.im [1]. [0]: https://tools.ietf.org/html/rfc6350#section-6.4.3 [1]: https://github.com/siacs/Conversations/blob/master/README.md#how-does-the-address-book-integration-work
This commit is contained in:
parent
553b5e97a3
commit
a203ea5c97
|
@ -279,7 +279,13 @@ public abstract class ResultHandler {
|
|||
putExtra(intent, ContactsContract.Intents.Insert.NOTES, aggregatedNotes.substring(1));
|
||||
}
|
||||
|
||||
if (instantMessenger != null && instantMessenger.startsWith("xmpp:")) {
|
||||
intent.putExtra(ContactsContract.Intents.Insert.IM_PROTOCOL, ContactsContract.CommonDataKinds.Im.PROTOCOL_JABBER);
|
||||
intent.putExtra(ContactsContract.Intents.Insert.IM_HANDLE, instantMessenger.substring(5));
|
||||
} else {
|
||||
putExtra(intent, ContactsContract.Intents.Insert.IM_HANDLE, instantMessenger);
|
||||
}
|
||||
|
||||
putExtra(intent, ContactsContract.Intents.Insert.POSTAL, address);
|
||||
if (addressType != null) {
|
||||
int type = toAddressContractType(addressType);
|
||||
|
|
Loading…
Reference in a new issue