mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-18 00:16:21 +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);
|
||||
|
||||
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) {
|
||||
|
||||
Reference in New Issue
Block a user