# HG changeset patch # User Matthew Wild # Date 1631563850 -3600 # Node ID 41ddb782320c490b5311ce942a1846dfe778aa2f # Parent 76af816739f3a8b53a9ee2e5d8ed048148f88198 mod_debug_omemo: Improve no keys/devices cases diff -r 76af816739f3 -r 41ddb782320c mod_debug_omemo/mod_debug_omemo.lua --- a/mod_debug_omemo/mod_debug_omemo.lua Mon Sep 13 21:47:01 2021 +0200 +++ b/mod_debug_omemo/mod_debug_omemo.lua Mon Sep 13 21:10:50 2021 +0100 @@ -159,6 +159,8 @@ type = message.attr.type or "normal"; direction = direction; encryption = is_encrypted and "encrypted" or "unencrypted"; + has_any_keys = not message_rids:empty(); + has_no_keys = message_rids:empty(); }; data.omemo = { @@ -176,7 +178,7 @@ }; end else - data.omemo.devices[false] = { status = "No devices", }; + data.omemo.devices[false] = { status = "No devices have published OMEMO keys on this account" }; end event.response.headers.content_type = "text/html; charset=utf-8"; diff -r 76af816739f3 -r 41ddb782320c mod_debug_omemo/view.tpl.html --- a/mod_debug_omemo/view.tpl.html Mon Sep 13 21:47:01 2021 +0200 +++ b/mod_debug_omemo/view.tpl.html Mon Sep 13 21:10:50 2021 +0100 @@ -186,6 +186,8 @@

This was an {message.encryption} {message.direction} {message.type} message. The sending device id was {omemo.sender_id}.

Recipient devices

+ + {message.has_any_keys& @@ -197,7 +199,9 @@ } -
Device ID{item.status?Unknown device} {item.prekey&Used pre-key} {item.comment?}
+ } + + {message.has_no_keys&

This message did not contain any OMEMO keys.

}

Account status

{user}'s account has {omemo.status} with OMEMO.