Mercurial > eldonilo > lightstring
comparison plugins/presence.js @ 69:03ccf507ecda
Fix presence plugin.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Thu, 02 Feb 2012 01:56:28 +0100 |
parents | a118a7822410 |
children | bfa3c003fc1d |
comparison
equal
deleted
inserted
replaced
68:e1ccfb580228 | 69:03ccf507ecda |
---|---|
23 (function() { | 23 (function() { |
24 var legal_types = ['error', 'probe', 'subscribe', 'subscribed', 'unavailable', 'unsubscribe', 'unsubscribed']; | 24 var legal_types = ['error', 'probe', 'subscribe', 'subscribed', 'unavailable', 'unsubscribe', 'unsubscribed']; |
25 | 25 |
26 Lightstring.plugins['presence'] = { | 26 Lightstring.plugins['presence'] = { |
27 stanzas: { | 27 stanzas: { |
28 presence: function(object) { | 28 out: function(object) { |
29 if (object) { | 29 if (object) { |
30 var payloads = ""; | 30 var payloads = ""; |
31 var attributs = ""; | 31 var attributs = ""; |
32 if (object.type && legal_types.indexOf(object.type) !== -1) | 32 if (object.type && legal_types.indexOf(object.type) !== -1) |
33 attributs += " type='" + object.type + "'"; | 33 attributs += " type='" + object.type + "'"; |
52 } else | 52 } else |
53 return "<presence/>"; | 53 return "<presence/>"; |
54 }, | 54 }, |
55 }, | 55 }, |
56 methods: { | 56 methods: { |
57 presence: function(aObject) { | 57 send: function(aObject) { |
58 this.send(Lightstring.stanzas.presence(aObject)); | 58 this.send(Lightstring.stanzas.presence.out(aObject)); |
59 } | 59 } |
60 } | 60 } |
61 }; | 61 }; |
62 })(); | 62 })(); |