Software /
code /
prosody
Comparison
plugins/mod_pubsub/pubsub.lib.lua @ 9235:7fbcabee6df1
mod_pubsub: Preserve current subscription options if given a partial form
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 31 Aug 2018 23:54:13 +0200 |
parent | 9212:127af0795e93 |
child | 9244:b3b156bd9914 |
comparison
equal
deleted
inserted
replaced
9234:d00e8ec7ece2 | 9235:7fbcabee6df1 |
---|---|
570 return true; | 570 return true; |
571 elseif not ret then | 571 elseif not ret then |
572 origin.send(pubsub_error_reply(stanza, "not-subscribed")); | 572 origin.send(pubsub_error_reply(stanza, "not-subscribed")); |
573 return true; | 573 return true; |
574 end | 574 end |
575 local new_subopts, err = subscribe_options_form:data(options.tags[1]); | 575 local old_subopts = ret; |
576 local new_subopts, err = subscribe_options_form:data(options.tags[1], old_subopts); | |
576 if not new_subopts then | 577 if not new_subopts then |
577 origin.send(pubsub_error_reply(stanza, ret)); | 578 origin.send(pubsub_error_reply(stanza, ret)); |
578 return true; | 579 return true; |
579 end | 580 end |
580 local ok, err = service:add_subscription(node, stanza.attr.from, jid, new_subopts); | 581 local ok, err = service:add_subscription(node, stanza.attr.from, jid, new_subopts); |