aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-08-05 15:52:19 +0200
committerKim Alvefur <zash@zash.se>2018-08-05 15:52:19 +0200
commitdb6c6745ebc9622aed762a892e81461cae9c154b (patch)
tree2ed8743401217edba1bfe410cc6f67f9f5b55dd7
parent6e61be70af9faf316147876d15e160d1f9a49a06 (diff)
downloadprosody-db6c6745ebc9622aed762a892e81461cae9c154b.tar.gz
prosody-db6c6745ebc9622aed762a892e81461cae9c154b.zip
mod_pubsub: Pass the current values to dataforms
-rw-r--r--plugins/mod_pubsub/pubsub.lib.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/plugins/mod_pubsub/pubsub.lib.lua b/plugins/mod_pubsub/pubsub.lib.lua
index 9c12572a..adee989f 100644
--- a/plugins/mod_pubsub/pubsub.lib.lua
+++ b/plugins/mod_pubsub/pubsub.lib.lua
@@ -662,7 +662,12 @@ function handlers.owner_set_configure(origin, stanza, config, service)
origin.send(st.error_reply(stanza, "modify", "bad-request", "Missing dataform"));
return true;
end
- local form_data, err = node_config_form:data(config_form);
+ local ok, old_config = service:get_node_config(node, stanza.attr.from);
+ if not ok then
+ origin.send(pubsub_error_reply(stanza, old_config));
+ return true;
+ end
+ local form_data, err = node_config_form:data(config_form, old_config);
if not form_data then
origin.send(st.error_reply(stanza, "modify", "bad-request", err));
return true;