feat: Show active and trust status in /omemo fingerprint

The /omemo fingerprint command provided a list of all keys ever
seen for a contact but did not indicate which keys were currently "active"
(present in the latest server device list). This made it difficult for users
to identify which fingerprints actually required verification to fix
encryption issues.

Users can now easily distinguish between devices currently in use and
historical keys that no longer matter.

When encryption fails users can immediately see which "active" key is
"untrusted," allowing them to verify the correct fingerprint fast.

Function `omemo_is_device_active` will check if a fingerprint belongs
to a device currently announced by the contacts server.
This commit is contained in:
Michael Vetter
2026-03-06 23:57:44 +01:00
parent 99c03f8c3b
commit 5a3083f273
4 changed files with 54 additions and 1 deletions

View File

@@ -8686,8 +8686,9 @@ cmd_omemo_fingerprint(ProfWin* window, const char* const command, gchar** args)
for (GList* fingerprint = fingerprints; fingerprint != NULL; fingerprint = fingerprint->next) {
auto_char char* formatted_fingerprint = omemo_format_fingerprint(fingerprint->data);
gboolean trusted = omemo_is_trusted_identity(jid->barejid, fingerprint->data);
gboolean active = omemo_is_device_active(jid->barejid, fingerprint->data);
win_println(window, THEME_DEFAULT, "-", "%s's OMEMO fingerprint: %s%s", jid->barejid, formatted_fingerprint, trusted ? " (trusted)" : "");
win_println(window, THEME_DEFAULT, "-", "%s's OMEMO fingerprint: %s%s%s", jid->barejid, formatted_fingerprint, trusted ? " (trusted)" : " (untrusted)", active ? " (active)" : " (inactive)");
}
g_list_free(fingerprints);