Update deprecated email extraction in p_gpg_decrypt
Some checks failed
CI / Linux (debian) (pull_request) Successful in 14m16s
CI / Linux (fedora) (pull_request) Successful in 15m34s
CI / Linux (arch) (pull_request) Successful in 16m45s
CI / Check spelling (pull_request) Successful in 15s
CI / Check coding style (pull_request) Failing after 1m43s
CI / Linux (ubuntu) (pull_request) Successful in 12m39s

Fixes arch build.

Since gpgme v2 release, https://github.com/gpg/gpgme/blob/master/NEWS, the gpgme_key_get_string_attr as well as GPGME_ATTR_EMAIL are REMOVED.

Fixes #2
Closes #2
This commit is contained in:
developer1
2025-06-19 17:29:29 +02:00
parent 5385cc28be
commit 57a172fa60

View File

@@ -656,11 +656,15 @@ p_gpg_decrypt(const char* const cipher)
error = gpgme_get_key(ctx, recipient->keyid, &key, 1);
if (!error && key) {
const char* addr = gpgme_key_get_string_attr(key, GPGME_ATTR_EMAIL, NULL, 0);
if (addr) {
g_string_append(recipients_str, addr);
for (gpgme_user_id_t uid = key->uids; uid != NULL; uid = uid->next) {
if (uid->email) {
g_string_append(recipients_str, uid->email);
break;
}
}
gpgme_key_unref(key);
} else if (error) {
log_warning("GPGME error: %s", gpgme_strerror(error));
}
if (recipient->next) {