aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2022-03-17 10:22:47 +0000
committerMatthew Wild <mwild1@gmail.com>2022-03-17 10:22:47 +0000
commit7881c5d0935b643dc18428a190d50d863b7bed51 (patch)
tree70456ce6c446fc90c00c9a10084a4b5e54b2b01f /plugins
parentb617c24af4e1cc79fd27ed3dc852d6b9e53be543 (diff)
downloadprosody-7881c5d0935b643dc18428a190d50d863b7bed51.tar.gz
prosody-7881c5d0935b643dc18428a190d50d863b7bed51.zip
mod_admin_shell: Add session.write() method to write data to client with no \n
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_admin_shell.lua7
1 files changed, 5 insertions, 2 deletions
diff --git a/plugins/mod_admin_shell.lua b/plugins/mod_admin_shell.lua
index 35124e79..c0aed977 100644
--- a/plugins/mod_admin_shell.lua
+++ b/plugins/mod_admin_shell.lua
@@ -83,8 +83,8 @@ function runner_callbacks:error(err)
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 @@ function console:new_session(admin_session)
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;
};