aboutsummaryrefslogtreecommitdiffstats
path: root/util/adhoc.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2020-02-26 00:59:35 +0100
committerKim Alvefur <zash@zash.se>2020-02-26 00:59:35 +0100
commit80a38cc8731fcb38f9ed7f4aa20c8e9a2071467f (patch)
tree9f7bb1b30ae558c86c01f93d03cce84ee1379012 /util/adhoc.lua
parent9a83f0e20bc0873067795672558fd078b64028c8 (diff)
downloadprosody-80a38cc8731fcb38f9ed7f4aa20c8e9a2071467f.tar.gz
prosody-80a38cc8731fcb38f9ed7f4aa20c8e9a2071467f.zip
util.adhoc: Allow passing dataforms in initial command
This might not be quite legal per XEP-0050, but makes it possible to call simpler commands without keeping state across another roundtrip.
Diffstat (limited to 'util/adhoc.lua')
-rw-r--r--util/adhoc.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/util/adhoc.lua b/util/adhoc.lua
index d81b8242..19c94c34 100644
--- a/util/adhoc.lua
+++ b/util/adhoc.lua
@@ -2,7 +2,7 @@
local function new_simple_form(form, result_handler)
return function(self, data, state)
- if state then
+ if state or data.form then
if data.action == "cancel" then
return { status = "canceled" };
end
@@ -16,7 +16,7 @@ end
local function new_initial_data_form(form, initial_data, result_handler)
return function(self, data, state)
- if state then
+ if state or data.form then
if data.action == "cancel" then
return { status = "canceled" };
end