# HG changeset patch # User Matthew Wild # Date 1743438731 -3600 # Node ID c0ef5d089e765aac37e5d1ae6ebcd0f19a453845 # Parent 99ba0b89e531e08bbf2640d6a899e37a7235288a# Parent c8e534b4f2e240b35035ba34c429a0d4b6189d5a Merge 13.0->trunk diff -r 99ba0b89e531 -r c0ef5d089e76 plugins/mod_admin_shell.lua --- a/plugins/mod_admin_shell.lua Mon Mar 31 16:43:06 2025 +0100 +++ b/plugins/mod_admin_shell.lua Mon Mar 31 17:32:11 2025 +0100 @@ -205,7 +205,13 @@ event.origin.send(st.stanza("repl-result", { type = "error" }):text("Internal error - unexpected input")); return true; end - input_promise.resolve(event.stanza:get_text()); + local status = event.stanza.attr.status or "submit"; + local text = event.stanza:get_text(); + if status == "submit" then + input_promise.resolve(text); + else + input_promise.reject(status == "cancel" and (text ~= "" and text) or "cancelled"); + end return true; end); diff -r 99ba0b89e531 -r c0ef5d089e76 util/prosodyctl/shell.lua --- a/util/prosodyctl/shell.lua Mon Mar 31 16:43:06 2025 +0100 +++ b/util/prosodyctl/shell.lua Mon Mar 31 17:32:11 2025 +0100 @@ -134,7 +134,11 @@ end if stanza.attr.type == "password" then local password = human_io.read_password(); - client.send(st.stanza("repl-requested-input", { type = stanza.attr.type, id = stanza.attr.id }):text(password)); + client.send(st.stanza("repl-requested-input", { + type = stanza.attr.type; + id = stanza.attr.id; + status = password and "submit" or "cancel"; + }):text(password or "")); else io.stderr:write("Internal error - unexpected input request type "..tostring(stanza.attr.type).."\n"); os.exit(1);