[balsa/69-resend-message] send: Avoid signing and encrypting when resending
- From: Peter Bloomfield <peterb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [balsa/69-resend-message] send: Avoid signing and encrypting when resending
- Date: Thu, 3 Mar 2022 02:33:18 +0000 (UTC)
commit e54a37d4e84fcca423941ed446480f6f7797f179
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date: Wed Mar 2 21:32:20 2022 -0500
send: Avoid signing and encrypting when resending
libbalsa/send.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/libbalsa/send.c b/libbalsa/send.c
index c88298cee..69d7d4808 100644
--- a/libbalsa/send.c
+++ b/libbalsa/send.c
@@ -1242,6 +1242,7 @@ create_mime_message(LibBalsaMessage *message,
LibBalsaIdentity *identity;
#endif /* ENABLE_AUTOCRYPT */
GDateTime *datetime;
+ gboolean resending = libbalsa_message_get_user_header(message, "X-Balsa-Resend") != NULL;
/* attach the public key only if we send the message, not if we just postpone it */
if (!postponing &&
@@ -1399,7 +1400,7 @@ create_mime_message(LibBalsaMessage *message,
LibBalsaMsgCreateResult crypt_res = LIBBALSA_MESSAGE_CREATE_OK;
/* in '2440 mode, touch *only* the first body! */
- if (!postponing &&
+ if (!resending && !postponing &&
(body == libbalsa_message_get_body_list(body->message)) &&
((gpg_mode = libbalsa_message_get_gpg_mode(message)) > 0) &&
((gpg_mode & LIBBALSA_PROTECT_OPENPGP) != 0)) {
@@ -1428,7 +1429,7 @@ create_mime_message(LibBalsaMessage *message,
body = body->next;
}
- if (attach_pubkey) {
+ if (!resending && attach_pubkey) {
GMimePart *pubkey_part;
pubkey_part = lb_create_pubkey_part(message, parent, error);
@@ -1446,8 +1447,7 @@ create_mime_message(LibBalsaMessage *message,
}
}
- if ((libbalsa_message_get_user_header(message, "X-Balsa-Resend") == NULL) &&
- (libbalsa_message_get_body_list(message) != NULL) && !postponing) {
+ if (!resending && (libbalsa_message_get_body_list(message) != NULL) && !postponing) {
LibBalsaMsgCreateResult crypt_res =
do_multipart_crypto(message, &mime_root, parent, error);
if (crypt_res != LIBBALSA_MESSAGE_CREATE_OK) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]