From 95b5facf3bc6ec7b346ea6dff07522fc9aceda4e Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sat, 2 May 2020 20:39:33 +0200 Subject: 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 `>`. --- plugins/mod_admin_telnet.lua | 10 +++------- 1 file 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 = {}; -- cgit v1.2.3