Mercurial > prosody-hg
diff util/adhoc.lua @ 10667:49312378ba1d
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.
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Wed, 26 Feb 2020 00:59:35 +0100 |
| parents | e5d00bf4a4d5 |
| children | e10567199f02 |
line wrap: on
line diff
--- a/util/adhoc.lua Mon Feb 24 23:33:53 2020 +0100 +++ b/util/adhoc.lua Wed Feb 26 00:59:35 2020 +0100 @@ -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 @@ 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
