Changeset

144:febc3992bee6

clix.watch_pep: Handle being built without stanza indentation support :indent() is a prosody trunk feature
author Kim Alvefur <zash@zash.se>
date Mon, 16 Nov 2020 17:18:39 +0100
parents 143:6b1fc3238318
children 145:6e05b25c2669
files clix/watch_pep.lua
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/clix/watch_pep.lua	Mon Nov 16 17:17:54 2020 +0100
+++ b/clix/watch_pep.lua	Mon Nov 16 17:18:39 2020 +0100
@@ -31,7 +31,11 @@
 		if payload.attr.xmlns == "urn:xmpp:json:0" then
 			print(payload:get_tex())
 		elseif opts.pretty then
-			print(payload:indent(nil, "  "):pretty_print());
+			if payload.indent then
+				print(payload:indent(nil, "  "):pretty_print());
+			else
+				print(payload:pretty_print());
+			end
 		else
 			print(payload);
 		end