mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-29 09:16:22 +00:00
Update deprecated email extraction in p_gpg_decrypt
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:
@@ -656,11 +656,15 @@ p_gpg_decrypt(const char* const cipher)
|
|||||||
error = gpgme_get_key(ctx, recipient->keyid, &key, 1);
|
error = gpgme_get_key(ctx, recipient->keyid, &key, 1);
|
||||||
|
|
||||||
if (!error && key) {
|
if (!error && key) {
|
||||||
const char* addr = gpgme_key_get_string_attr(key, GPGME_ATTR_EMAIL, NULL, 0);
|
for (gpgme_user_id_t uid = key->uids; uid != NULL; uid = uid->next) {
|
||||||
if (addr) {
|
if (uid->email) {
|
||||||
g_string_append(recipients_str, addr);
|
g_string_append(recipients_str, uid->email);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
gpgme_key_unref(key);
|
gpgme_key_unref(key);
|
||||||
|
} else if (error) {
|
||||||
|
log_warning("GPGME error: %s", gpgme_strerror(error));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (recipient->next) {
|
if (recipient->next) {
|
||||||
|
|||||||
Reference in New Issue
Block a user