mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-12-26 12:37:58 +01:00
Uses voice as default number detail, if no type is available.
This commit is contained in:
parent
035bbea837
commit
db72917bb4
1 changed files with 7 additions and 1 deletions
|
@ -18,6 +18,7 @@ package org.jivesoftware.smackx.vcardtemp.provider;
|
|||
|
||||
import org.jivesoftware.smack.SmackException;
|
||||
import org.jivesoftware.smack.provider.IQProvider;
|
||||
import org.jivesoftware.smack.util.StringUtils;
|
||||
import org.jivesoftware.smackx.vcardtemp.packet.VCard;
|
||||
import org.xmlpull.v1.XmlPullParser;
|
||||
import org.xmlpull.v1.XmlPullParserException;
|
||||
|
@ -172,7 +173,12 @@ public class VCardProvider extends IQProvider<VCard> {
|
|||
isWork = false;
|
||||
}
|
||||
else {
|
||||
if (telLabel != null && "NUMBER".equals(name)) {
|
||||
if ("NUMBER".equals(name)) {
|
||||
if (StringUtils.isNullOrEmpty(telLabel)) {
|
||||
// RFC 2426 § 3.3.1:
|
||||
// "The default type is 'voice'"
|
||||
telLabel = "VOICE";
|
||||
}
|
||||
if (isWork) {
|
||||
vCard.setPhoneWork(telLabel, parser.nextText());
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue