Software /
code /
prosody
Comparison
plugins/mod_admin_shell.lua @ 13796:c8e534b4f2e2 13.0
mod_admin_shell, prosodyctl shell: Report command failure when no password entered (fixes #1907)
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Mon, 31 Mar 2025 17:30:50 +0100 |
parent | 13770:a28349b8a387 |
child | 13819:3ee95eb17045 |
comparison
equal
deleted
inserted
replaced
13794:471b676e64eb | 13796:c8e534b4f2e2 |
---|---|
203 local input_promise = event.origin.pending_inputs:get(input_id); | 203 local input_promise = event.origin.pending_inputs:get(input_id); |
204 if not input_promise then | 204 if not input_promise then |
205 event.origin.send(st.stanza("repl-result", { type = "error" }):text("Internal error - unexpected input")); | 205 event.origin.send(st.stanza("repl-result", { type = "error" }):text("Internal error - unexpected input")); |
206 return true; | 206 return true; |
207 end | 207 end |
208 input_promise.resolve(event.stanza:get_text()); | 208 local status = event.stanza.attr.status or "submit"; |
209 local text = event.stanza:get_text(); | |
210 if status == "submit" then | |
211 input_promise.resolve(text); | |
212 else | |
213 input_promise.reject(status == "cancel" and (text ~= "" and text) or "cancelled"); | |
214 end | |
209 return true; | 215 return true; |
210 end); | 216 end); |
211 | 217 |
212 function console:new_session(admin_session) | 218 function console:new_session(admin_session) |
213 local session = { | 219 local session = { |