Mercurial > eldonilo > lightstring
comparison 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 |
comparison
equal
deleted
inserted
replaced
107:704ce44c1a22 | 108:5cb4733c5189 |
---|---|
38 var payloads = ""; | 38 var payloads = ""; |
39 var attributs = ""; | 39 var attributs = ""; |
40 if (object.type && legal_types.indexOf(object.type) !== -1) | 40 if (object.type && legal_types.indexOf(object.type) !== -1) |
41 attributs += " type='" + object.type + "'"; | 41 attributs += " type='" + object.type + "'"; |
42 | 42 |
43 if (object.to) | |
44 attributs += " to='" + object.to + "'"; | |
45 | |
43 if (object.priority) | 46 if (object.priority) |
44 payloads += "<priority>" + object.priority + "</priority>"; | 47 payloads += "<priority>" + object.priority + "</priority>"; |
45 | 48 |
46 if (object.show) | 49 if (object.show) |
47 payloads += "<show>" + object.show + "</show>"; | 50 payloads += "<show>" + object.show + "</show>"; |
63 }, | 66 }, |
64 methods: { | 67 methods: { |
65 send: function(aObject) { | 68 send: function(aObject) { |
66 this.send(Lightstring.stanzas.presence.out(aObject)); | 69 this.send(Lightstring.stanzas.presence.out(aObject)); |
67 } | 70 } |
68 } | 71 }, |
69 }; | 72 }; |
73 | |
74 Object.defineProperties(Lightstring.Stanza.prototype, { | |
75 'show': { | |
76 get : function() { | |
77 return this.el.getAttribute('show'); | |
78 }, | |
79 enumerable : true, | |
80 configurable : true | |
81 }, | |
82 'priority': { | |
83 get : function() { | |
84 return this.el.getAttribute('priority'); | |
85 }, | |
86 enumerable : true, | |
87 configurable : true | |
88 }, | |
89 'status': { | |
90 get : function() { | |
91 return this.el.getAttribute('status'); | |
92 }, | |
93 enumerable : true, | |
94 configurable : true | |
95 }, | |
96 }) | |
70 })(); | 97 })(); |