[Commits] [SCM] claws branch, master, updated. 3.17.5-28-g650ca51b2

paul at claws-mail.org paul at claws-mail.org
Sat Jul 11 10:44:02 CEST 2020


The branch, master has been updated
       via  650ca51b2e5b5048d7f65407d600dacdbed93996 (commit)
       via  762988d1ac56d5f4b4b3bbd958f3ac4b6dc53725 (commit)
      from  859ba3ef4b86f13f119d25e61043f93cf4c97a22 (commit)

Summary of changes:
 src/compose.c | 37 ++++++++++++++++++++++++++-----------
 1 file changed, 26 insertions(+), 11 deletions(-)


- Log -----------------------------------------------------------------
commit 650ca51b2e5b5048d7f65407d600dacdbed93996
Author: Paul <paul at claws-mail.org>
Date:   Sat Jul 11 09:43:57 2020 +0100

    warn about privacy system 'none' and auto sign/encrypt being enabled in all applicable scenarios

diff --git a/src/compose.c b/src/compose.c
index 748800c07..1df165aa9 100644
--- a/src/compose.c
+++ b/src/compose.c
@@ -191,6 +191,13 @@ typedef enum {
 #define COMPOSE_DRAFT_TIMEOUT_UNSET -1
 #define COMPOSE_DRAFT_TIMEOUT_FORBIDDEN -2
 
+#define COMPOSE_PRIVACY_WARNING() {							\
+	alertpanel_error(_("You have opted to sign and/or encrypt this "		\
+			   "message but have not selected a privacy system.\n\n"	\
+			   "Signing and encrypting have been disabled for this "	\
+			   "message."));						\
+}
+
 static GdkColor default_header_bgcolor = {
 	(gulong)0,
 	(gushort)0,
@@ -1012,10 +1019,7 @@ Compose *compose_generic_new(PrefsAccount *account, const gchar *mailto, FolderI
 
 	if (privacy_system_can_sign(compose->privacy_system) == FALSE &&
 	    (account->default_encrypt || account->default_sign))
-		alertpanel_error(_("You have opted to sign and/or encrypt this "
-				   "message but have not selected a privacy system.\n\n"
-				   "Signing and encrypting have been disabled for this "
-				   "message."));
+		COMPOSE_PRIVACY_WARNING();
 
 	/* override from name if mailto asked for it */
 	if (mailto_from) {
@@ -1692,12 +1696,10 @@ static Compose *compose_generic_reply(MsgInfo *msginfo,
 	g_free(s_system);
 
 	if (privacy_system_can_sign(compose->privacy_system) == FALSE &&
-	    ((account->default_encrypt_reply && MSG_IS_ENCRYPTED(compose->replyinfo->flags)) ||
+	    ((account->default_encrypt || account->default_sign) ||
+	     (account->default_encrypt_reply && MSG_IS_ENCRYPTED(compose->replyinfo->flags)) ||
 	     (account->default_sign_reply && MSG_IS_SIGNED(compose->replyinfo->flags))))
-		alertpanel_error(_("You have opted to sign and/or encrypt this "
-				   "message but have not selected a privacy system.\n\n"
-				   "Signing and encrypting have been disabled for this "
-				   "message."));
+		COMPOSE_PRIVACY_WARNING();
 
 	SIGNAL_BLOCK(textbuf);
 	
@@ -1902,6 +1904,10 @@ Compose *compose_forward(PrefsAccount *account, MsgInfo *msginfo,
 #endif
 	SIGNAL_UNBLOCK(textbuf);
 	
+	if (privacy_system_can_sign(compose->privacy_system) == FALSE &&
+	    (account->default_encrypt || account->default_sign))
+		COMPOSE_PRIVACY_WARNING();
+
 	cursor_pos = quote_fmt_get_cursor_pos();
 	if (cursor_pos == -1)
 		gtk_widget_grab_focus(compose->header_last->entry);
@@ -1983,6 +1989,9 @@ static Compose *compose_forward_multiple(PrefsAccount *account, GSList *msginfo_
 
 	compose = compose_create(account, ((MsgInfo *)msginfo_list->data)->folder, COMPOSE_FORWARD, FALSE);
 	compose_apply_folder_privacy_settings(compose, ((MsgInfo *)msginfo_list->data)->folder);
+	if (privacy_system_can_sign(compose->privacy_system) == FALSE &&
+	    (account->default_encrypt || account->default_sign))
+		COMPOSE_PRIVACY_WARNING();
 
 	compose->updating = TRUE;
 
@@ -2393,6 +2402,9 @@ Compose *compose_reedit(MsgInfo *msginfo, gboolean batch)
 		compose_activate_privacy_system(compose, account, FALSE);
 	}
 	compose_apply_folder_privacy_settings(compose, msginfo->folder);
+	if (privacy_system_can_sign(compose->privacy_system) == FALSE &&
+	    (account->default_encrypt || account->default_sign))
+		COMPOSE_PRIVACY_WARNING();
 
 	compose->targetinfo = procmsg_msginfo_copy(msginfo);
 	compose->targetinfo->tags = g_slist_copy(msginfo->tags);

commit 762988d1ac56d5f4b4b3bbd958f3ac4b6dc53725
Author: Paul <paul at claws-mail.org>
Date:   Sat Jul 11 09:41:20 2020 +0100

    when redirecting make encrypt and sign buttons inactive, and don't care about folder privacy settings

diff --git a/src/compose.c b/src/compose.c
index 4f7f08a38..748800c07 100644
--- a/src/compose.c
+++ b/src/compose.c
@@ -1,6 +1,6 @@
 /*
  * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2019 the Claws Mail team and Hiroyuki Yamamoto
+ * Copyright (C) 1999-2020 the Claws Mail team and Hiroyuki Yamamoto
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -2520,7 +2520,6 @@ Compose *compose_redirect(PrefsAccount *account, MsgInfo *msginfo,
 	cm_return_val_if_fail(account != NULL, NULL);
 
 	compose = compose_create(account, msginfo->folder, COMPOSE_REDIRECT, batch);
-	compose_apply_folder_privacy_settings(compose, msginfo->folder);
 
 	compose->updating = TRUE;
 
@@ -2598,6 +2597,10 @@ Compose *compose_redirect(PrefsAccount *account, MsgInfo *msginfo,
 		gtk_widget_set_sensitive(compose->toolbar->linewrap_current_btn, FALSE);
 	if (compose->toolbar->linewrap_all_btn)
 		gtk_widget_set_sensitive(compose->toolbar->linewrap_all_btn, FALSE);
+	if (compose->toolbar->privacy_sign_btn)
+		gtk_widget_set_sensitive(compose->toolbar->privacy_sign_btn, FALSE);
+	if (compose->toolbar->privacy_encrypt_btn)
+		gtk_widget_set_sensitive(compose->toolbar->privacy_encrypt_btn, FALSE);
 
 	compose->modified = FALSE;
 	compose_set_title(compose);

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list