diff options
Diffstat (limited to 'plugins/mod_pubsub.lua')
-rw-r--r-- | plugins/mod_pubsub.lua | 11 |
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 |