feat: Provide descriptive fallback messages for OMEMO decryption failures

If an incoming OMEMO message failed to decrypt (due to missing session
keys or untrusted identities), Profanity would fall back to displaying
the raw XMPP body. This usually contained a generic string like "This
message is encrypted with OMEMO,".

We wrote the detailed reason in the debug logs but the user only saw the
fallback message and probably wondered *why* the message wasn't
displayed properly.

I'm unsure if we should display the fallback message as well though.
This commit is contained in:
Michael Vetter
2026-03-07 00:31:44 +01:00
parent b20e3f1a0c
commit 4d49c2b746
7 changed files with 169 additions and 12 deletions

View File

@@ -129,6 +129,27 @@ omemo_encrypt_file(FILE* in, FILE* out, off_t file_size, int* gcry_res)
};
void omemo_free(void* a) {};
char*
omemo_on_message_recv(const char* const from, uint32_t sid,
const unsigned char* const iv, size_t iv_len,
GList* keys, const unsigned char* const payload,
size_t payload_len, gboolean muc, gboolean* trusted, omemo_error_t* error)
{
if (error) {
*error = OMEMO_ERR_NONE;
}
return NULL;
}
char*
omemo_receive_message(xmpp_stanza_t* const stanza, gboolean* trusted, omemo_error_t* error)
{
if (error) {
*error = OMEMO_ERR_NONE;
}
return NULL;
}
uint32_t
omemo_device_id()
{