Mercurial > eldonilo > lightstring
diff plugins.js @ 19:fc577e5b2f4a
add pusbub config plugins
author | Sonny Piers <sonny.piers@gmail.com> |
---|---|
date | Sat, 28 Jan 2012 01:24:36 +0100 |
parents | 6707f450549e |
children | b6e4bc19ff5a |
line wrap: on
line diff
--- a/plugins.js +++ b/plugins.js @@ -185,6 +185,16 @@ Lightstring.stanza.pubsub = { 'delete': function(aTo, aNode, aURI) { return "<iq type='set' to='"+aTo+"'><pubsub xmlns='"+Lightstring.NS.pubsub_owner+"'><delete node='"+aNode+"'/></pubsub></iq>"; }, + config: function(aTo, aNode, aFields) { + var iq = "<iq type='set' to='"+aTo+"'><pubsub xmlns='"+Lightstring.NS.pubsub+"'><configure node='"+aNode+"'><x xmlns='"+Lightstring.NS.x+"' type='submit'>"; + if(aFields) { + aFields.forEach(function(field) { + iq += field; + }); + } + iq += "</x></configure></pubsub></iq>"; + return iq; + }, create: function(aTo, aNode, aFields) { var iq = "<iq type='set' to='"+aTo+"'><pubsub xmlns='"+Lightstring.NS.pubsub+"'><create node='"+aNode+"'/>"; if(aFields) {