aboutsummaryrefslogtreecommitdiffstats
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
commit7137e467a0a251a18dbade4d32b4222dae475231 (patch)
tree9f7bb1b30ae558c86c01f93d03cce84ee1379012
parentf50d8689147238ae9cd383c1bd83cbc542f8e5b7 (diff)
downloadprosody-7137e467a0a251a18dbade4d32b4222dae475231.tar.gz
prosody-7137e467a0a251a18dbade4d32b4222dae475231.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.
-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