Search in sources :

Example 1 with BoBData

use of org.jivesoftware.smackx.bob.BoBData 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);
}
Also used : BoBData(org.jivesoftware.smackx.bob.BoBData) BoBIQ(org.jivesoftware.smackx.bob.element.BoBIQ) BoBHash(org.jivesoftware.smackx.bob.BoBHash)

Aggregations

BoBData (org.jivesoftware.smackx.bob.BoBData)1 BoBHash (org.jivesoftware.smackx.bob.BoBHash)1 BoBIQ (org.jivesoftware.smackx.bob.element.BoBIQ)1