Mercurial > eldonilo > lightstring
diff plugins/presence.js @ 108:5cb4733c5189
many api changes
author | Sonny Piers <sonny@fastmail.net> |
---|---|
date | Fri, 13 Jul 2012 15:26:18 +0200 |
parents | c06ec02217ee |
children |
line wrap: on
line diff
--- a/plugins/presence.js +++ b/plugins/presence.js @@ -40,6 +40,9 @@ if (object.type && legal_types.indexOf(object.type) !== -1) attributs += " type='" + object.type + "'"; + if (object.to) + attributs += " to='" + object.to + "'"; + if (object.priority) payloads += "<priority>" + object.priority + "</priority>"; @@ -65,6 +68,30 @@ send: function(aObject) { this.send(Lightstring.stanzas.presence.out(aObject)); } - } + }, }; + + Object.defineProperties(Lightstring.Stanza.prototype, { + 'show': { + get : function() { + return this.el.getAttribute('show'); + }, + enumerable : true, + configurable : true + }, + 'priority': { + get : function() { + return this.el.getAttribute('priority'); + }, + enumerable : true, + configurable : true + }, + 'status': { + get : function() { + return this.el.getAttribute('status'); + }, + enumerable : true, + configurable : true + }, + }) })();