aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2011-08-14 13:36:54 -0400
committerMatthew Wild <mwild1@gmail.com>2011-08-14 13:36:54 -0400
commit0b42d443f1b70d34aea7bc52aaca3145edafa664 (patch)
treecebb5fc0e67d588fb33b77c636421203644cbb34 /plugins
parent257fa9dbd0715c3621214bd6cb9c118a2fa1b19b (diff)
downloadprosody-0b42d443f1b70d34aea7bc52aaca3145edafa664.tar.gz
prosody-0b42d443f1b70d34aea7bc52aaca3145edafa664.zip
mod_pubsub: Handle options tag in subscription request (currently doesn't work as options_form is not defined)
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_pubsub.lua11
1 files changed, 9 insertions, 2 deletions
diff --git a/plugins/mod_pubsub.lua b/plugins/mod_pubsub.lua
index fd307583..d5c14605 100644
--- a/plugins/mod_pubsub.lua
+++ b/plugins/mod_pubsub.lua
@@ -110,7 +110,11 @@ end
function handlers.set_subscribe(origin, stanza, subscribe)
local node, jid = subscribe.attr.node, subscribe.attr.jid;
- local ok, ret = service:add_subscription(node, stanza.attr.from, jid);
+ local options_tag, options = stanza.tags[1]:get_child("options"), nil;
+ if options_tag then
+ options = options_form:data(options_tag.tags[1]);
+ end
+ local ok, ret = service:add_subscription(node, stanza.attr.from, jid, options);
local reply;
if ok then
reply = st.reply(stanza)
@@ -119,7 +123,10 @@ function handlers.set_subscribe(origin, stanza, subscribe)
node = node,
jid = jid,
subscription = "subscribed"
- });
+ }):up();
+ if options_tag then
+ reply:add_child(options_tag);
+ end
else
reply = pubsub_error_reply(stanza, ret);
end