diff options
| author | Simeon Simeonov | 2018-02-26 12:17:39 +0100 |
|---|---|---|
| committer | Simeon Simeonov | 2018-02-26 12:17:39 +0100 |
| commit | ade95c14a055a404fd1f2b9cb6da94d12cc61a98 (patch) | |
| tree | c38f7fe5e34beef03e18ce8e1d0e3aee14164a64 /src/rfc2015.c | |
| parent | 0b3cbf57875fd692e4ba0b336fefa4bee1ed00dc (diff) | |
Signature box patch
Diffstat (limited to 'src/rfc2015.c')
| -rw-r--r-- | src/rfc2015.c | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/src/rfc2015.c b/src/rfc2015.c index ebfa96c..48825e2 100644 --- a/src/rfc2015.c +++ b/src/rfc2015.c | |||
| @@ -210,8 +210,12 @@ static void check_signature(MimeInfo *mimeinfo, MimeInfo *partinfo, FILE *fp) | |||
| 210 | gchar *tmp_file; | 210 | gchar *tmp_file; |
| 211 | gint n_exclude_chars = 0; | 211 | gint n_exclude_chars = 0; |
| 212 | 212 | ||
| 213 | if (prefs_common.gpg_signature_popup) | 213 | if (prefs_common.gpg_signature_popup && |
| 214 | prefs_common.gpg_signature_popup_mode == 1) | ||
| 215 | { | ||
| 216 | /* FIXME: Perhaps some macro instead of 1 */ | ||
| 214 | statuswindow = gpgmegtk_sig_status_create(); | 217 | statuswindow = gpgmegtk_sig_status_create(); |
| 218 | } | ||
| 215 | 219 | ||
| 216 | err = gpgme_new(&ctx); | 220 | err = gpgme_new(&ctx); |
| 217 | if (err) { | 221 | if (err) { |
| @@ -309,8 +313,21 @@ leave: | |||
| 309 | result = _("Error verifying the signature"); | 313 | result = _("Error verifying the signature"); |
| 310 | } | 314 | } |
| 311 | debug_print("verification status: %s\n", result); | 315 | debug_print("verification status: %s\n", result); |
| 312 | if (prefs_common.gpg_signature_popup) | 316 | if (prefs_common.gpg_signature_popup && |
| 317 | prefs_common.gpg_signature_popup_mode == 1) | ||
| 318 | { | ||
| 319 | /* FIXME: Perhaps some macro instead of 1 */ | ||
| 320 | gpgmegtk_sig_status_update(statuswindow, ctx); | ||
| 321 | } else if (prefs_common.gpg_signature_popup && | ||
| 322 | verifyresult->signatures->status != GPG_ERR_NO_DATA && | ||
| 323 | verifyresult->signatures->status != GPG_ERR_NO_ERROR) | ||
| 324 | { | ||
| 325 | /* prefs_common.gpg_signature_popup_mode == 0 is useless as long as | ||
| 326 | * there are only two modes (0 and 1) | ||
| 327 | */ | ||
| 328 | statuswindow = gpgmegtk_sig_status_create(); | ||
| 313 | gpgmegtk_sig_status_update(statuswindow, ctx); | 329 | gpgmegtk_sig_status_update(statuswindow, ctx); |
| 330 | } | ||
| 314 | 331 | ||
| 315 | g_free (partinfo->sigstatus); | 332 | g_free (partinfo->sigstatus); |
| 316 | partinfo->sigstatus = g_strdup (result); | 333 | partinfo->sigstatus = g_strdup (result); |
| @@ -319,8 +336,11 @@ leave: | |||
| 319 | gpgme_data_release(text); | 336 | gpgme_data_release(text); |
| 320 | if (ctx) | 337 | if (ctx) |
| 321 | gpgme_release(ctx); | 338 | gpgme_release(ctx); |
| 322 | if (prefs_common.gpg_signature_popup) | 339 | if (prefs_common.gpg_signature_popup) { |
| 340 | /* gpgmegtk_sig_status_destroy handles NULL params so no complicated | ||
| 341 | check is needed */ | ||
| 323 | gpgmegtk_sig_status_destroy(statuswindow); | 342 | gpgmegtk_sig_status_destroy(statuswindow); |
| 343 | } | ||
| 324 | } | 344 | } |
| 325 | 345 | ||
| 326 | /* | 346 | /* |
| @@ -427,7 +447,11 @@ static gpgme_data_t pgp_decrypt(MsgInfo *msginfo, MimeInfo *partinfo, FILE *fp) | |||
| 427 | debug_print("verification status: %s\n", result); | 447 | debug_print("verification status: %s\n", result); |
| 428 | debug_print("full status: %s\n", | 448 | debug_print("full status: %s\n", |
| 429 | msginfo->encinfo->sigstatus_full); | 449 | msginfo->encinfo->sigstatus_full); |
| 430 | if (prefs_common.gpg_signature_popup) { | 450 | if (prefs_common.gpg_signature_popup && |
| 451 | ((prefs_common.gpg_signature_popup_mode == 1) || | ||
| 452 | (verifyresult->signatures->status != GPG_ERR_NO_DATA && | ||
| 453 | verifyresult->signatures->status != GPG_ERR_NO_ERROR))) | ||
| 454 | { | ||
| 431 | GpgmegtkSigStatus statuswindow; | 455 | GpgmegtkSigStatus statuswindow; |
| 432 | statuswindow = gpgmegtk_sig_status_create(); | 456 | statuswindow = gpgmegtk_sig_status_create(); |
| 433 | gpgmegtk_sig_status_update(statuswindow, ctx); | 457 | gpgmegtk_sig_status_update(statuswindow, ctx); |
