1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00

ox: print more error messages to UI

This commit is contained in:
Michael Vetter 2022-05-03 23:17:20 +02:00
parent c3deb5d325
commit 58911926de

View File

@ -914,6 +914,7 @@ p_ox_gpg_signcrypt(const char* const sender_barejid, const char* const recipient
// lookup own key // lookup own key
recp[0] = _ox_key_lookup(sender_barejid, TRUE); recp[0] = _ox_key_lookup(sender_barejid, TRUE);
if (error != 0) { if (error != 0) {
cons_show_error("Can't find OX key for %s", xmpp_jid_me);
log_error("OX: Key not found for %s. Error: %s", xmpp_jid_me, gpgme_strerror(error)); log_error("OX: Key not found for %s. Error: %s", xmpp_jid_me, gpgme_strerror(error));
return NULL; return NULL;
} }
@ -927,13 +928,14 @@ p_ox_gpg_signcrypt(const char* const sender_barejid, const char* const recipient
// lookup key of recipient // lookup key of recipient
recp[1] = _ox_key_lookup(recipient_barejid, FALSE); recp[1] = _ox_key_lookup(recipient_barejid, FALSE);
if (error != 0) { if (error != 0) {
cons_show_error("Can't find OX key for %s", xmpp_jid_recipient);
log_error("OX: Key not found for %s. Error: %s", xmpp_jid_recipient, gpgme_strerror(error)); log_error("OX: Key not found for %s. Error: %s", xmpp_jid_recipient, gpgme_strerror(error));
return NULL; return NULL;
} }
recp[2] = NULL; recp[2] = NULL;
log_debug("%s <%s>", recp[0]->uids->name, recp[0]->uids->email); log_debug("OX: %s <%s>", recp[0]->uids->name, recp[0]->uids->email);
log_debug("%s <%s>", recp[1]->uids->name, recp[1]->uids->email); log_debug("OX: %s <%s>", recp[1]->uids->name, recp[1]->uids->email);
gpgme_encrypt_flags_t flags = 0; gpgme_encrypt_flags_t flags = 0;
@ -1110,6 +1112,7 @@ _ox_key_is_usable(gpgme_key_t key, const char* const barejid, gboolean secret)
gboolean result = TRUE; gboolean result = TRUE;
if (key->revoked || key->expired || key->disabled) { if (key->revoked || key->expired || key->disabled) {
cons_show_error("%s's key is revoked, expired or disabled", barejid);
log_info("OX: %s's key is revoked, expired or disabled", barejid); log_info("OX: %s's key is revoked, expired or disabled", barejid);
result = FALSE; result = FALSE;
} }
@ -1119,6 +1122,7 @@ _ox_key_is_usable(gpgme_key_t key, const char* const barejid, gboolean secret)
// trust leven in gpg. I'll add an example to this commit body. // trust leven in gpg. I'll add an example to this commit body.
/* /*
if (key->owner_trust < GPGME_VALIDITY_MARGINAL) { if (key->owner_trust < GPGME_VALIDITY_MARGINAL) {
cons_show_error(" %s's key is has a trust level lower than marginal", barejid);
log_info("OX: Owner trust of %s's key is < GPGME_VALIDITY_MARGINAL", barejid); log_info("OX: Owner trust of %s's key is < GPGME_VALIDITY_MARGINAL", barejid);
result = FALSE; result = FALSE;
} }