diff options
author | Kim Alvefur <zash@zash.se> | 2020-05-02 20:39:33 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2020-05-02 20:39:33 +0200 |
commit | 95b5facf3bc6ec7b346ea6dff07522fc9aceda4e (patch) | |
tree | 17a84e2722d0d61ccc895cd3c295616608bad27f | |
parent | f1c4d468e2134147b6aec12910837d05b332b8d6 (diff) | |
download | prosody-95b5facf3bc6ec7b346ea6dff07522fc9aceda4e.tar.gz prosody-95b5facf3bc6ec7b346ea6dff07522fc9aceda4e.zip |
mod_admin_telnet: Don't pretty-print the normal console stuff
Typing e.g. `c2s` would dump out a bunch of stuff that would probably
just confuse users.
Now you only get pretty-printing when poking around in the internals
with `>`.
-rw-r--r-- | plugins/mod_admin_telnet.lua | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/plugins/mod_admin_telnet.lua b/plugins/mod_admin_telnet.lua index 792f4f78..a5657d09 100644 --- a/plugins/mod_admin_telnet.lua +++ b/plugins/mod_admin_telnet.lua @@ -145,10 +145,10 @@ function console:process_line(session, line) local taskok, message = chunk(); if not message then - if type(taskok) ~= "string" then + if type(taskok) ~= "string" and useglobalenv then taskok = session.serialize(taskok); end - session.print("Result: "..taskok); + session.print("Result: "..tostring(taskok)); return; elseif (not taskok) and message then session.print("Command completed with a problem"); @@ -156,11 +156,7 @@ function console:process_line(session, line) return; end - if type(message) ~= "string" then - message = session.serialize(message); - end - - session.print("OK: "..message); + session.print("OK: "..tostring(message)); end local sessions = {}; |