diff options
author | Kim Alvefur <zash@zash.se> | 2020-05-02 20:41:35 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2020-05-02 20:41:35 +0200 |
commit | 9e60a1be7cc7882c59595198a8ef3b07de3f8d4f (patch) | |
tree | 4b0821e828649d8194a4eeed3d1f2e482c816c79 /plugins | |
parent | 4500aabbae173b93a9725de59acbd4f1b56696bb (diff) | |
download | prosody-9e60a1be7cc7882c59595198a8ef3b07de3f8d4f.tar.gz prosody-9e60a1be7cc7882c59595198a8ef3b07de3f8d4f.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.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/mod_admin_telnet.lua | 4 |
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; |