Example #1
0
 get: function () {
     var NS = 'vcard-temp:x:update';
     var update = stanza.find(this.xml, NS, 'x');
     if (!update.length) {
         return '';
     }
     return stanza.getSubText(update[0], NS, 'photo');
 },
Example #2
0
 get: function () {
     return stanza.getSubText(this.xml, this._NS, 'before');
 },
Example #3
0
function getAvatarData() {
    return stanza.getSubText(this.xml, 'urn:xmpp:avatar:data', 'data');
}
Example #4
0

function MUCJoin(data, xml) {
    return stanza.init(this, xml, data);
}
MUCJoin.prototype = {
    constructor: {
        value: MUCJoin 
    },
    NS: 'http://jabber.org/protocol/muc',
    EL: 'x',
    _name: 'joinMuc',
    toString: stanza.toString,
    toJSON: stanza.toJSON,
    get password() {
        return stanza.getSubText(this.xml, this.NS, 'password');
    },
    set password(value) {
        stanza.setSubText(this.xml, this.NS, 'password', value);
    },
    get history() {
        var result = {};
        var hist = stanza.find(this.xml, this.NS, 'history');

        if (!hist.length) {
            return {};
        }
        hist = hist[0];

        var maxchars = hist.getAttribute('maxchars') || '';
        var maxstanzas = hist.getAttribute('maxstanas') || '';
Example #5
0

function RSM(data, xml) {
    return stanza.init(this, xml, data);
}
RSM.prototype = {
    constructor: {
        value: RSM 
    },
    NS: 'http://jabber.org/protocol/rsm',
    EL: 'set',
    _name: 'rsm',
    toString: stanza.toString,
    toJSON: stanza.toJSON,
    get after() {
        return stanza.getSubText(this.xml, this.NS, 'after');
    },
    set after(value) {
        stanza.setSubText(this.xml, this.NS, 'after', value);
    },
    get before() {
        return stanza.getSubText(this.xml, this.NS, 'before');
    },
    set before(value) {
        stanza.setSubText(this.xml, this.NS, 'before', value);
    },
    get count() {
        return parseInt(stanza.getSubText(this.xml, this.NS, 'count') || '0', 10);
    },
    set count(value) {
        stanza.setSubText(this.xml, this.NS, 'count', value.toString());
Example #6
0
 get: function () {
     return stanza.getSubText(this.xml, NS, 'alternative-session');
 },
Example #7
0
 toString: stanza.toString,
 toJSON: stanza.toJSON,
 get media() {
     return stanza.getAttribute(this.xml, 'media');
 },
 set media(value) {
     stanza.setAttribute(this.xml, 'media', value);
 },
 get ssrc() {
     return stanza.getAttribute(this.xml, 'ssrc');
 },
 set ssrc(value) {
     stanza.setAttribute(this.xml, 'ssrc', value);
 },
 get bandwidth() {
     return stanza.getSubText(this.xml, this.NS, 'bandwidth');
 },
 set bandwidth(value) {
     stanza.setSubText(this.xml, this.NS, 'bandwidth', value);
 },
 get bandwidthType() {
     return stanza.getSubAttribute(this.xml, this.NS, 'bandwidth', 'type');
 },
 set bandwidthType(value) {
     stanza.setSubAttribute(this.xml, this.NS, 'bandwidth', 'type', value);
 },
 get payloadTypes() {
     var payloadTypes = stanza.find(this.xml, 'urn:xmpp:jingle:apps:rtp:1', 'payload-type');
     var results = [];
     _.forEach(payloadTypes, function (xml) {
         results.push(new PayloadType({}, xml).toJSON());
Example #8
0

function Bind(data, xml) {
    return stanza.init(this, xml, data);
}
Bind.prototype = {
    constructor: {
        value: Bind
    },
    _name: 'bind',
    NS: 'urn:ietf:params:xml:ns:xmpp-bind',
    EL: 'bind',
    toString: stanza.toString,
    toJSON: stanza.toJSON,
    get resource() {
        return stanza.getSubText(this.xml, this.NS, 'resource');
    },
    set resource(value) {
        stanza.setSubText(this.xml, this.NS, 'resource');
    },
    get jid() {
        return stanza.getSubText(this.xml, this.NS, 'jid');
    },
    set jid(value) {
        stanza.setSubText(this.xml, this.NS, 'jid');
    }
};


stanza.extend(Iq, Bind);
stanza.extend(StreamFeatures, Bind);
Example #9
0
 return stanza.getMultiSubText(this.xml, this._NS, 'option', function (sub) {
     return stanza.getSubText(sub, self._NS, 'value');
 });
Example #10
0
 get: function () {
     return stanza.getSubText(this.xml, ERR_NS, 'redirect');
 },
Example #11
0
 get: function () {
     return stanza.getSubText(this.xml, ERR_NS, 'gone');
 },
Example #12
0

function DataForm(data, xml) {
    return stanza.init(this, xml, data);
}
DataForm.prototype = {
    constructor: {
        value: DataForm 
    },
    NS: 'jabber:x:data',
    EL: 'x',
    _name: 'form',
    toString: stanza.toString,
    toJSON: stanza.toJSON,
    get title() {
        return stanza.getSubText(this.xml, this.NS, 'title');
    },
    set title(value) {
        stanza.setSubText(this.xml, this.NS, 'title', value);
    },
    get instructions() {
        return stanza.getMultiSubText(this.xml, this.NS, 'title').join('\n');
    },
    set instructions(value) {
        stanza.setMultiSubText(this.xml, this.NS, 'title', value.split('\n'));
    },
    get type() {
        return stanza.getAttribute(this.xml, 'type', 'form');
    },
    set type(value) {
        stanza.setAttribute(this.xml, 'type', value);
Example #13
0
            value = false;
        }
        stanza.setAttribute(this.xml, 'type', value);
    },
    get status() {
        var statuses = this.$status;
        return statuses[this.lang] || '';
    },
    get $status() {
        return stanza.getSubLangText(this.xml, this.NS, 'status', this.lang);
    },
    set status(value) {
        stanza.setSubLangText(this.xml, this.NS, 'status', value, this.lang);
    },
    get priority() {
        return stanza.getSubText(this.xml, this.NS, 'priority');
    },
    set priority(value) {
        stanza.setSubText(this.xml, this.NS, 'priority', value);
    },
    get show() {
        return stanza.getSubText(this.xml, this.NS, 'show');
    },
    set show(value) {
        stanza.setSubText(this.xml, this.NS, 'show', value);
    }
};

stanza.topLevel(Presence);

Example #14
0
 function (xml, NS, sub) {
     return new JID(stanza.getSubText(xml, NS, sub));
 },