From 27bbd90669cf314d6945892456e4ed0a20590302 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 5 Aug 2018 15:52:19 +0200 Subject: mod_pubsub: Pass the current values to dataforms --- plugins/mod_pubsub/pubsub.lib.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'plugins') 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; -- cgit v1.2.3