use of org.jivesoftware.smackx.bob.BoBHash in project Smack by igniterealtime.
the class BoBIQProvider method parse.
@Override
public BoBIQ parse(XmlPullParser parser, int initialDepth) throws Exception {
String cid = parser.getAttributeValue("", "cid");
BoBHash bobHash = BoBHash.fromCid(cid);
String dataType = parser.getAttributeValue("", "type");
int maxAge = ParserUtils.getIntegerAttribute(parser, "max-age", -1);
String base64EncodedData = parser.nextText();
BoBData bobData;
if (dataType != null) {
bobData = new BoBData(dataType, base64EncodedData, maxAge);
} else {
bobData = null;
}
return new BoBIQ(bobHash, bobData);
}