From c67b380f102cb8e056db83043ee26a1747ccd0c0 Mon Sep 17 00:00:00 2001 From: Paul Date: Mon, 18 Nov 2019 13:07:48 +0000 Subject: [PATCH] when user cancels the signing passphrase dialogue, don't bother the user with an "error" dialogue --- src/compose.c | 8 +++++++- src/compose.h | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/compose.c b/src/compose.c index fc89629e3..7a0ab8302 100644 --- a/src/compose.c +++ b/src/compose.c @@ -5274,6 +5274,9 @@ static void _display_queue_error(ComposeQueueResult val) alertpanel_error(_("Could not queue message for sending:\n\n" "Couldn't get recipient encryption key.")); break; + case COMPOSE_QUEUE_SIGNING_CANCELLED: + debug_print("signing cancelled\n"); + break; default: /* unhandled error */ debug_print("oops, unhandled compose_queue() return value %d\n", @@ -5912,7 +5915,10 @@ static gint compose_write_to_file(Compose *compose, FILE *fp, gint action, gbool compose->account, from_addr)) { g_free(from_name); g_free(from_addr); - return COMPOSE_QUEUE_ERROR_SIGNING_FAILED; + if (!privacy_peek_error()) + return COMPOSE_QUEUE_SIGNING_CANCELLED; + else + return COMPOSE_QUEUE_ERROR_SIGNING_FAILED; } g_free(from_name); g_free(from_addr); diff --git a/src/compose.h b/src/compose.h index d0d920aee..6fd032a4a 100644 --- a/src/compose.h +++ b/src/compose.h @@ -86,7 +86,8 @@ typedef enum COMPOSE_QUEUE_ERROR_SIGNING_FAILED = -3, COMPOSE_QUEUE_ERROR_ENCRYPT_FAILED = -4, COMPOSE_QUEUE_ERROR_CHAR_CONVERSION = -5, - COMPOSE_QUEUE_ERROR_NO_ENCRYPTION_KEY = -6 + COMPOSE_QUEUE_ERROR_NO_ENCRYPTION_KEY = -6, + COMPOSE_QUEUE_SIGNING_CANCELLED = -7 } ComposeQueueResult; typedef enum { -- 2.25.1