Mercurial > eldonilo > lightstring
changeset 19:fc577e5b2f4a
add pusbub config plugins
author | Sonny Piers <sonny.piers@gmail.com> |
---|---|
date | Sat, 28 Jan 2012 01:24:36 +0100 |
parents | 48bc65a0e0f1 |
children | b6e4bc19ff5a |
files | plugins.js |
diffstat | 1 files changed, 10 insertions(+), 0 deletions(-) [+] |
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) {