# HG changeset patch # User Sonny Piers # Date 1336049803 -7200 # Node ID 646695bde8e98c610d21ff6a6f232e5609378948 # Parent 7affe7ac8fc7b4db0e831294109c192968222d54 better pubsub.items method diff --git a/plugins/pubsub.js b/plugins/pubsub.js --- a/plugins/pubsub.js +++ b/plugins/pubsub.js @@ -34,8 +34,14 @@ getConfig: function(aTo, aNode) { return ""; }, - items: function(aTo, aNode) { - return ""; + items: function(aTo, aNode, aItems) { + var stanza = ""; + if (aItems) { + aItems.forEach(function(item) { + stanza += "" + }); + } + return stanza + ""; }, affiliations: function(aTo, aNode) { return ""; @@ -81,8 +87,8 @@ }, }, methods: { - items: function(aTo, aNode, aOnSuccess, aOnError) { - this.send(Lightstring.stanzas.pubsub.items(aTo, aNode), function(stanza) { + items: function(aTo, aNode, aItems, aOnSuccess, aOnError) { + this.send(Lightstring.stanzas.pubsub.items(aTo, aNode, aItems), function(stanza) { var items = stanza.DOM.querySelectorAll('item') || []; stanza.items = items; if (aOnSuccess)