# HG changeset patch # User Matthew Wild # Date 1647512567 0 # Node ID ddf02f2a33545ca603ec7248ac91adb0c1db7437 # Parent bdb9577a48300993720955aedfc8b588219311af mod_admin_shell: Add session.write() method to write data to client with no \n diff -r bdb9577a4830 -r ddf02f2a3354 plugins/mod_admin_shell.lua --- a/plugins/mod_admin_shell.lua Thu Mar 17 10:21:43 2022 +0000 +++ b/plugins/mod_admin_shell.lua Thu Mar 17 10:22:47 2022 +0000 @@ -83,8 +83,8 @@ self.data.print("Error: "..tostring(err)); end -local function send_repl_output(session, line) - return session.send(st.stanza("repl-output"):text(tostring(line))); +local function send_repl_output(session, line, attr) + return session.send(st.stanza("repl-output", attr):text(tostring(line))); end function console:new_session(admin_session) @@ -99,6 +99,9 @@ end return send_repl_output(admin_session, table.concat(t, "\t")); end; + write = function (t) + return send_repl_output(admin_session, t, { eol = "0" }); + end; serialize = tostring; disconnect = function () admin_session:close(); end; };