[Commits] [SCM] claws branch, master, updated. 3.9.3-8-g6a4badf

colin at claws-mail.org colin at claws-mail.org
Sat Dec 28 18:32:16 CET 2013


The branch master of project "claws" (Claws Mail) has been updated
       via  6a4badf693d075f151638f9497fa6b467e4d27b3 (commit)
       via  7bd41ae67a9fe6bd800d4cec9f2f1e012a244ba6 (commit)
       via  3d876eaf2fc33ebe36d36ca5d11a35b80868fee0 (commit)
       via  18696ff22a66c3d790abdc5f95b8ab5488ff2cb5 (commit)
       via  9a56118f8110ab403cb94547cca11c0cc3ab490c (commit)
      from  02b5ac9ed2d474e546a655c636e4c9e43dd3250b (commit)


- Log -----------------------------------------------------------------
commit 6a4badf693d075f151638f9497fa6b467e4d27b3
Author: Colin Leroy <colin at colino.net>
Date:   Sat Dec 28 18:31:22 2013 +0100

    Fix bug #2991, "POP3 sessions duplicated" on race conditions. Patch by
    Paul Rolland.

diff --git a/src/folder.c b/src/folder.c
index 676c7a9..4c7a045 100644
--- a/src/folder.c
+++ b/src/folder.c
@@ -4260,13 +4260,16 @@ static gchar * folder_item_get_tree_identifier(FolderItem * item)
 #define TEMP_FOLDER "TEMP_FOLDER"
 #define PROCESSING_FOLDER_ITEM "processing"	
 
-static FolderItem *processing_folder_item;
-
-static void folder_create_processing_folder(void)
+static FolderItem *folder_create_processing_folder(int account_id)
 {
 	Folder *processing_folder;
+	FolderItem *processing_folder_item;
 	gchar      *tmpname;
 
+	gchar *processing_folder_item_name = NULL;
+
+        processing_folder_item_name = g_strdup_printf("%s-%d", PROCESSING_FOLDER_ITEM, account_id);
+
 	if ((processing_folder = folder_find_from_name(TEMP_FOLDER, mh_get_class())) == NULL) {
 		gchar *tmppath;
 
@@ -4285,35 +4288,37 @@ static void folder_create_processing_folder(void)
            this.  */
 	if (!is_relative_filename(LOCAL_FOLDER(processing_folder)->rootpath))
 		tmpname = g_strconcat(LOCAL_FOLDER(processing_folder)->rootpath,
-				      G_DIR_SEPARATOR_S, PROCESSING_FOLDER_ITEM,
+				      G_DIR_SEPARATOR_S, 
+				      processing_folder_item_name,
 				      NULL);
 	else
 		tmpname = g_strconcat(get_home_dir(), G_DIR_SEPARATOR_S,
 				      LOCAL_FOLDER(processing_folder)->rootpath,
-				      G_DIR_SEPARATOR_S, PROCESSING_FOLDER_ITEM,
+				      G_DIR_SEPARATOR_S, 
+				      processing_folder_item_name,
 				      NULL);
 
 	if (!is_dir_exist(tmpname)) {
 		debug_print("*TMP* creating %s\n", tmpname);
 		processing_folder_item = processing_folder->klass->create_folder(processing_folder,
 								   	         processing_folder->node->data,
-										 PROCESSING_FOLDER_ITEM);
+										 processing_folder_item_name);
 	} else {
 		debug_print("*TMP* already created\n");
-		processing_folder_item = folder_item_new(processing_folder, PROCESSING_FOLDER_ITEM, PROCESSING_FOLDER_ITEM);
+		processing_folder_item = folder_item_new(processing_folder, processing_folder_item_name, processing_folder_item_name);
 		g_assert(processing_folder_item);
 		folder_item_append(processing_folder->node->data, processing_folder_item);
 	}
+	g_free(processing_folder_item_name);
 	g_assert(processing_folder_item != NULL);
 	g_free(tmpname);
+
+	return(processing_folder_item);
 }
 
-FolderItem *folder_get_default_processing(void)
+FolderItem *folder_get_default_processing(int account_id)
 {
-	if (!processing_folder_item) {
-		folder_create_processing_folder();
-	}
-	return processing_folder_item;
+	return folder_create_processing_folder(account_id);
 }
 
 /* folder_persist_prefs_new() - return hash table with persistent
diff --git a/src/folder.h b/src/folder.h
index 44f69bb..191dcd8 100644
--- a/src/folder.h
+++ b/src/folder.h
@@ -895,7 +895,7 @@ FolderItem *folder_get_default_queue	(void);
 FolderItem *folder_get_default_queue_for_class(FolderType type);
 FolderItem *folder_get_default_trash	(void);
 FolderItem *folder_get_default_trash_for_class(FolderType type);
-FolderItem *folder_get_default_processing (void);
+FolderItem *folder_get_default_processing (int account_id);
 void folder_set_missing_folders		(void);
 void folder_unref_account_all		(PrefsAccount	*account);
 
diff --git a/src/inc.c b/src/inc.c
index 254e52e..c8c68ac 100644
--- a/src/inc.c
+++ b/src/inc.c
@@ -288,6 +288,8 @@ gint inc_account_mail(MainWindow *mainwin, PrefsAccount *account)
 
 	if (inc_lock_count) return 0;
 
+	if (account->receive_in_progress) return 0;
+
 	if (prefs_common.work_offline && 
 	    !inc_offline_should_override(TRUE,
 		_("Claws Mail needs network access in order "
@@ -367,9 +369,11 @@ void inc_all_account_mail(MainWindow *mainwin, gboolean autocheck,
 		PrefsAccount *account = list->data;
 
 		if (account->recv_at_getall) {
-			session = inc_session_new(account);
-			if (session)
-				queue_list = g_list_append(queue_list, session);
+			if (!(account->receive_in_progress)) {
+				session = inc_session_new(account);
+				if (session)
+					queue_list = g_list_append(queue_list, session);
+			}
 		}
 	}
 
@@ -695,7 +699,7 @@ static gint inc_start(IncProgressDialog *inc_dialog)
 			inbox = folder_get_default_inbox();
 
 		/* get list of messages in processing */
-		processing = folder_get_default_processing();
+		processing = folder_get_default_processing(pop3_session->ac_prefs->account_id);
 		folder_item_scan(processing);
 		msglist = folder_item_get_msg_list(processing);
 
@@ -1128,7 +1132,7 @@ static gint inc_drop_message(Pop3Session *session, const gchar *file)
 	}
 
 	/* CLAWS: claws uses a global .processing folder for the filtering. */
-	dropfolder = folder_get_default_processing();
+	dropfolder = folder_get_default_processing(session->ac_prefs->account_id);
 
 	/* add msg file to drop folder */
 	if ((msgnum = folder_item_add_msg(
diff --git a/src/mbox.c b/src/mbox.c
index 7ad328c..04f5108 100644
--- a/src/mbox.c
+++ b/src/mbox.c
@@ -128,7 +128,7 @@ gint proc_mbox(FolderItem *dest, const gchar *mbox, gboolean apply_filter,
 	folder_item_update_freeze();
 
 	if (apply_filter)
-		dropfolder = folder_get_default_processing();
+		dropfolder = folder_get_default_processing(account->account_id);
 	else
 		dropfolder = dest;
 	
diff --git a/src/pop.c b/src/pop.c
index c2f1d4b..a9a0472 100644
--- a/src/pop.c
+++ b/src/pop.c
@@ -519,6 +519,8 @@ Session *pop3_session_new(PrefsAccount *account)
 
 	cm_return_val_if_fail(account != NULL, NULL);
 
+	account->receive_in_progress = TRUE;
+
 	session = g_new0(Pop3Session, 1);
 
 	session_init(SESSION(session), account, FALSE);
@@ -567,6 +569,8 @@ static void pop3_session_destroy(Session *session)
 	g_free(pop3_session->user);
 	g_free(pop3_session->pass);
 	g_free(pop3_session->error_msg);
+
+	pop3_session->ac_prefs->receive_in_progress = FALSE;
 }
 
 static void pop3_get_uidl_table(PrefsAccount *ac_prefs, Pop3Session *session)
diff --git a/src/prefs_account.c b/src/prefs_account.c
index 7990a31..43295c0 100644
--- a/src/prefs_account.c
+++ b/src/prefs_account.c
@@ -3505,6 +3505,8 @@ void prefs_account_read_config(PrefsAccount *ac_prefs, const gchar *label)
 		privacy_prefs = NULL;
 	}
 
+	ac_prefs->receive_in_progress = FALSE;
+
 	prefs_custom_header_read_config(ac_prefs);
 }
 
diff --git a/src/prefs_account.h b/src/prefs_account.h
index 2ff9207..40b9301 100644
--- a/src/prefs_account.h
+++ b/src/prefs_account.h
@@ -105,6 +105,8 @@ struct _PrefsAccount
 
 	gint imap_auth_type;
 
+	gboolean receive_in_progress;
+
 	/* Send */
 	gboolean gen_msgid;
 	gboolean gen_xmailer;

commit 7bd41ae67a9fe6bd800d4cec9f2f1e012a244ba6
Author: Colin Leroy <colin at colino.net>
Date:   Sat Dec 28 18:15:31 2013 +0100

    Fix bug #3020, "Use theme doesn't change some icons until restart"

diff --git a/src/addr_compl.c b/src/addr_compl.c
index ed73557..7472fc1 100644
--- a/src/addr_compl.c
+++ b/src/addr_compl.c
@@ -969,6 +969,17 @@ static void addrcompl_add_entry( CompletionWindow *cw, gchar *address ) {
 #endif
 }
 
+void addrcompl_reflect_prefs_pixmap_theme(void) {
+	if (group_pixbuf) {
+		g_object_unref(G_OBJECT(group_pixbuf));
+		group_pixbuf = NULL;
+	}
+	if (email_pixbuf) {
+		g_object_unref(G_OBJECT(email_pixbuf));
+		email_pixbuf = NULL;
+	}
+}
+
 /**
  * Completion idle function. This function is called by the main (UI) thread
  * during UI idle time while an address search is in progress. Items from the
diff --git a/src/addr_compl.h b/src/addr_compl.h
index 3dbdc8d..de9d4b1 100644
--- a/src/addr_compl.h
+++ b/src/addr_compl.h
@@ -54,4 +54,5 @@ void addrcompl_teardown		( void );
 
 void addr_compl_add_address1(const char *str, address_entry *ae);
 
+void addrcompl_reflect_prefs_pixmap_theme(void);
 #endif /* __ADDR_COMPL_H__ */
diff --git a/src/prefs_themes.c b/src/prefs_themes.c
index 2f3202c..6c69fba 100644
--- a/src/prefs_themes.c
+++ b/src/prefs_themes.c
@@ -428,14 +428,15 @@ static void prefs_themes_btn_use_clicked_cb(GtkWidget *widget, gpointer data)
 	gchar      *theme_str;
 
 	theme_str = tdata->displayed;
-	
+
 	g_free(prefs_common.pixmap_theme_path);
-	
+
         prefs_common.pixmap_theme_path = g_strdup(theme_str);
-       
+
         main_window_reflect_prefs_all_real(TRUE);
         compose_reflect_prefs_pixmap_theme();
-       
+	addrcompl_reflect_prefs_pixmap_theme();
+
 	prefs_themes_update_buttons(tdata);
 }
 

commit 3d876eaf2fc33ebe36d36ca5d11a35b80868fee0
Author: Colin Leroy <colin at colino.net>
Date:   Sat Dec 28 18:10:26 2013 +0100

    Add Palmer Dabbelt to Authors

diff --git a/AUTHORS b/AUTHORS
index e8804ed..2b3a16a 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -301,4 +301,4 @@ contributors (in addition to the above; based on Changelog)
 	Michal Gorny
 	Richard Palo
 	Marco Villegas
-
+	Palmer Dabbelt
diff --git a/src/gtk/authors.h b/src/gtk/authors.h
index 3e93882..0526ff8 100644
--- a/src/gtk/authors.h
+++ b/src/gtk/authors.h
@@ -104,6 +104,7 @@ static char *CONTRIBS_LIST[] = {
 "Natanael Copa",
 "Jonathan Corbet",
 "Christian Cornelssen",
+"Palmer Dabbelt",
 "George Danchev",
 "Matthieu Dazy",
 "Ben Deering",

commit 18696ff22a66c3d790abdc5f95b8ab5488ff2cb5
Author: Colin Leroy <colin at colino.net>
Date:   Sat Dec 28 18:08:38 2013 +0100

    Fix bug #3040, "Handle revoked GPG private keys". Patch by Palmer Dabbelt.

diff --git a/src/plugins/pgpcore/sgpgme.c b/src/plugins/pgpcore/sgpgme.c
index 77c0774..f06c88c 100644
--- a/src/plugins/pgpcore/sgpgme.c
+++ b/src/plugins/pgpcore/sgpgme.c
@@ -521,7 +521,7 @@ gboolean sgpgme_setup_signers(gpgme_ctx_t ctx, PrefsAccount *account,
 
 	if (config->sign_key != SIGN_KEY_DEFAULT) {
 		const gchar *keyid;
-		gpgme_key_t key, key2;
+		gpgme_key_t key, found_key;
 		gpgme_error_t err;
 
 		if (config->sign_key == SIGN_KEY_BY_FROM)
@@ -531,78 +531,71 @@ gboolean sgpgme_setup_signers(gpgme_ctx_t ctx, PrefsAccount *account,
 		else
 			goto bail;
 
-		err = gpgme_op_keylist_start(ctx, keyid, 1);
-		if (!err) {
-			do {
-				err = gpgme_op_keylist_next(ctx, &key);
-				if (!err && key && key->protocol == gpgme_get_protocol(ctx) &&
-				    !key->expired && !key->revoked && !key->disabled)
-					break;
-				if (!err && key && key->protocol != gpgme_get_protocol(ctx)) {
-					debug_print("skipping a key (wrong protocol %d)\n", key->protocol);
-					gpgme_key_release(key);
-				}
-				if (!err && key && (key->expired || key->revoked || key->disabled)) {
-					
-					debug_print("skipping a key");
-					if (key->expired) 
-						debug_print(" expired");
-					if (key->revoked) 
-						debug_print(" revoked");
-					if (key->disabled) 
-						debug_print(" disabled");
-					debug_print("\n");
-					gpgme_key_release(key);
-				}
-			} while (!err);
-		}
-		if (err) {
-			g_warning("setup_signers start: %s", gpgme_strerror(err));
-			privacy_set_error(_("Secret key not found (%s)"), gpgme_strerror(err));
-			goto bail;
-		}
-		
-		do {
-			err = gpgme_op_keylist_next(ctx, &key2);
-			if (!err && key2 && key2->protocol == gpgme_get_protocol(ctx) &&
-			    !key2->expired && !key2->revoked && !key2->disabled)
-				break;
-			if (!err && key2 && key2->protocol != gpgme_get_protocol(ctx)) {
-				debug_print("skipping a key (wrong protocol %d)\n", key2->protocol);
-				gpgme_key_release(key2);
+                found_key = NULL;
+		/* Look for any key, not just private ones, or GPGMe doesn't
+		 * correctly set the revoked flag. */
+		err = gpgme_op_keylist_start(ctx, keyid, 0);
+		while ((err = gpgme_op_keylist_next(ctx, &key)) == 0) {
+			if (key == NULL)
+				continue;
+
+			if (!key->can_sign)
+				continue;
+
+			if (key->protocol != gpgme_get_protocol(ctx)) {
+				debug_print("skipping a key (wrong protocol %d)\n", key->protocol);
+				gpgme_key_release(key);
+				continue;
 			}
-			if (!err && key2 && (key2->expired || key2->revoked || key2->disabled)) {
-					debug_print("skipping a key");
-					if (key2->expired) 
-						debug_print(" expired");
-					if (key2->revoked) 
-						debug_print(" revoked");
-					if (key2->disabled) 
-						debug_print(" disabled");
-					debug_print("\n");
-				gpgme_key_release(key2);
+
+			if (key->expired) {
+				debug_print("skipping a key, expired");
+				gpgme_key_release(key);
+				continue;
 			}
-		} while (!err);
-		if (!err) {
-			gpgme_key_release(key2);
-			g_warning("ambiguous specification of secret key '%s'\n",
-				keyid);
-			privacy_set_error(_("Secret key specification is ambiguous"));
-			goto bail;
-		}
-		
+			if (key->revoked) {
+				debug_print("skipping a key, revoked");
+				gpgme_key_release(key);
+				continue;
+			}
+			if (key->disabled) {
+				debug_print("skipping a key, disabled");
+				gpgme_key_release(key);
+				continue;
+			}
+
+			if (found_key != NULL) {
+				gpgme_key_release(key);
+				gpgme_op_keylist_end(ctx);
+				g_warning("ambiguous specification of secret key '%s'\n", keyid);
+				privacy_set_error(_("Secret key specification is ambiguous"));
+				goto bail;
+			}
+
+			found_key = key;
+                }
 		gpgme_op_keylist_end(ctx);
-		err = gpgme_signers_add(ctx, key);
-		debug_print("got key (proto %d (pgp %d, smime %d).\n", key->protocol,
-				GPGME_PROTOCOL_OpenPGP, GPGME_PROTOCOL_CMS);
-		gpgme_key_release(key);
-		
+
+		if (found_key == NULL) {
+			g_warning("setup_signers start: %s", gpgme_strerror(err));
+			privacy_set_error(_("Secret key not found (%s)"), gpgme_strerror(err));
+			goto bail;
+                }
+
+		err = gpgme_signers_add(ctx, found_key);
+		debug_print("got key (proto %d (pgp %d, smime %d).\n",
+			    found_key->protocol, GPGME_PROTOCOL_OpenPGP,
+			    GPGME_PROTOCOL_CMS);
+		gpgme_key_release(found_key);
+
 		if (err) {
-			g_warning("error adding secret key: %s\n", gpgme_strerror(err));
-			privacy_set_error(_("Error setting secret key: %s"), gpgme_strerror(err));
+			g_warning("error adding secret key: %s\n",
+				  gpgme_strerror(err));
+			privacy_set_error(_("Error setting secret key: %s"),
+					  gpgme_strerror(err));
 			goto bail;
 		}
-	}
+        }
 
 	prefs_gpg_account_free_config(config);
 

commit 9a56118f8110ab403cb94547cca11c0cc3ab490c
Author: Colin Leroy <colin at colino.net>
Date:   Sat Dec 28 17:40:12 2013 +0100

    Fix bug #3038, "Select A Folder incorrectly matches on number
    in parentheses". Match on FolderItem's name instead of displayed
    string.

diff --git a/src/foldersel.c b/src/foldersel.c
index ab512dc..a34d513 100644
--- a/src/foldersel.c
+++ b/src/foldersel.c
@@ -201,10 +201,18 @@ FolderItem *foldersel_folder_sel(Folder *cur_folder, FolderSelectionType type,
 static gboolean foldersel_search_name_func(GtkTreeModel *model, gint column,
 		const gchar *key, GtkTreeIter *iter, gpointer search_data)
 {
-	gchar *store_string;
+	gchar *store_string = NULL;
+	FolderItem *item;
 	gboolean retval;
 
-	gtk_tree_model_get(model, iter, column, &store_string, -1);
+	if (column == FOLDERSEL_FOLDERNAME) {
+		/* get the name of the FolderItem, not the displayed string */
+		gtk_tree_model_get(model, iter,
+			   FOLDERSEL_FOLDERITEM, &item, -1);
+		store_string = folder_item_get_name(item);
+	} else {
+		gtk_tree_model_get(model, iter, column, &store_string, -1);
+	}
 
 	if (!store_string || !key)
 		return FALSE;

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

Summary of changes:
 AUTHORS                      |    2 +-
 src/addr_compl.c             |   11 ++++
 src/addr_compl.h             |    1 +
 src/folder.c                 |   29 ++++++----
 src/folder.h                 |    2 +-
 src/foldersel.c              |   12 +++-
 src/gtk/authors.h            |    1 +
 src/inc.c                    |   14 +++--
 src/mbox.c                   |    2 +-
 src/plugins/pgpcore/sgpgme.c |  127 ++++++++++++++++++++----------------------
 src/pop.c                    |    4 ++
 src/prefs_account.c          |    2 +
 src/prefs_account.h          |    2 +
 src/prefs_themes.c           |    9 +--
 14 files changed, 125 insertions(+), 93 deletions(-)


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list