Mercurial > eldonilo > lightstring
comparison plugins/roster.js @ 106:c06ec02217ee
many changes
author | Sonny Piers <sonny@fastmail.net> |
---|---|
date | Tue, 26 Jun 2012 12:02:14 +0200 |
parents | 595be4a8584f |
children | 5cb4733c5189 |
comparison
equal
deleted
inserted
replaced
105:fb50311997b5 | 106:c06ec02217ee |
---|---|
49 "</query>" + | 49 "</query>" + |
50 "</iq>"; | 50 "</iq>"; |
51 } | 51 } |
52 }, | 52 }, |
53 methods: { | 53 methods: { |
54 'get': function(aSuccess, aError) { | 54 'get': function(aOnSuccess, aOnError) { |
55 this.send(Lightstring.stanzas.roster.get(), function(stanza) { | 55 this.send(Lightstring.stanzas.roster.get(), function(stanza) { |
56 var contacts = []; | 56 var contacts = []; |
57 | 57 |
58 var items = stanza.DOM.getElementsByTagName('item'); | 58 var items = stanza.el.getElementsByTagName('item'); |
59 | 59 |
60 for (var i = 0; i < items.length; i++) { | 60 for (var i = 0; i < items.length; i++) { |
61 var item = items[i]; | 61 var item = items[i]; |
62 var contact = {} | 62 var contact = {} |
63 | 63 |
85 | 85 |
86 stanza.roster = { | 86 stanza.roster = { |
87 contacts: contacts | 87 contacts: contacts |
88 }; | 88 }; |
89 | 89 |
90 if (aSuccess) | 90 if (aOnSuccess) |
91 aSuccess(stanza); | 91 aOnSuccess(stanza); |
92 }, aError); | 92 }, aOnError); |
93 } | 93 } |
94 } | 94 } |
95 }; | 95 }; |