Update deprecated email extraction in p_gpg_decrypt
Some checks failed
CI / Linux (arch) (pull_request) Successful in 12m32s
CI / Linux (debian) (pull_request) Successful in 12m25s
CI / Check spelling (pull_request) Successful in 16s
CI / Linux (fedora) (pull_request) Successful in 15m17s
CI / Linux (ubuntu) (pull_request) Successful in 14m13s
CI / Check coding style (pull_request) Failing after 4m24s
Some checks failed
CI / Linux (arch) (pull_request) Successful in 12m32s
CI / Linux (debian) (pull_request) Successful in 12m25s
CI / Check spelling (pull_request) Successful in 16s
CI / Linux (fedora) (pull_request) Successful in 15m17s
CI / Linux (ubuntu) (pull_request) Successful in 14m13s
CI / Check coding style (pull_request) Failing after 4m24s
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