clix.archive: Skip printing body-less messages

Mon, 08 Feb 2021 22:56:45 +0100

author
Kim Alvefur <zash@zash.se>
date
Mon, 08 Feb 2021 22:56:45 +0100
changeset 146
ae85457eca8e
parent 145
6e05b25c2669
child 147
0bc82a318c45

clix.archive: Skip printing body-less messages

These are more and more common in archives, e.g. receipts, errors, OMEMO
etc.

clix/archive.lua file | annotate | diff | comparison | revisions
--- a/clix/archive.lua	Mon Nov 23 23:52:31 2020 +0100
+++ b/clix/archive.lua	Mon Feb 08 22:56:45 2021 +0100
@@ -17,6 +17,7 @@
 	local function print_message(i)
 		-- TODO Roster lookup
 		local m = i.message;
+		if not m:get_child("body") then return end
 		local a = m.attr;
 		if i.stamp then
 			print(os.date("%Y-%m-%d %H:%M:%S", i.stamp));

mercurial