aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2020-05-02 20:41:35 +0200
committerKim Alvefur <zash@zash.se>2020-05-02 20:41:35 +0200
commit783f5430a57d1f543f0eddbc3d6b6a3185be8008 (patch)
tree4b0821e828649d8194a4eeed3d1f2e482c816c79
parent95b5facf3bc6ec7b346ea6dff07522fc9aceda4e (diff)
downloadprosody-783f5430a57d1f543f0eddbc3d6b6a3185be8008.tar.gz
prosody-783f5430a57d1f543f0eddbc3d6b6a3185be8008.zip
mod_admin_telnet: Use tostring as fallback in pretty printing
This has some nice effects such as functions, VirtualHosts and other things being printed using their `__tostring` metamethod.
-rw-r--r--plugins/mod_admin_telnet.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/plugins/mod_admin_telnet.lua b/plugins/mod_admin_telnet.lua
index a5657d09..3014517c 100644
--- a/plugins/mod_admin_telnet.lua
+++ b/plugins/mod_admin_telnet.lua
@@ -335,6 +335,10 @@ function def_env.output:configure(opts)
if type(opts) ~= "table" then
opts = { preset = opts };
end
+ if not opts.fallback then
+ -- XXX Error message passed to fallback is lost, does it matter?
+ opts.fallback = tostring;
+ end
for k,v in pairs(serialize_defaults) do
if opts[k] == nil then
opts[k] = v;