From: Paul Date: Thu, 22 Oct 2020 06:21:21 +0000 (+0100) Subject: fix bug 4394, 'folder processing runs on startup even if all rules are disabled' X-Git-Tag: 3.18.0~72 X-Git-Url: http://git.claws-mail.org/?p=claws.git;a=commitdiff_plain;h=c2d89cc36a96bd2de18e8e1b5a8e63f7dd21ee1b;ds=sidebyside fix bug 4394, 'folder processing runs on startup even if all rules are disabled' --- diff --git a/src/filtering.c b/src/filtering.c index 9a3cd95a0..edd0f3a9c 100644 --- a/src/filtering.c +++ b/src/filtering.c @@ -1,6 +1,6 @@ /* * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client - * Copyright (C) 1999-2015 Hiroyuki Yamamoto & The Claws Mail Team + * 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 @@ -790,6 +790,17 @@ static gboolean filtering_is_final_action(FilteringAction *filtering_action) } } +gboolean processing_enabled(GSList *filtering_list) +{ + GSList *l; + for (l = filtering_list; l != NULL; l = g_slist_next(l)) { + FilteringProp * filtering = (FilteringProp *) l->data; + if (filtering->enabled) + return TRUE; + } + return FALSE; +} + static gboolean filter_msginfo(GSList * filtering_list, MsgInfo * info, PrefsAccount* ac_prefs) { GSList *l; diff --git a/src/filtering.h b/src/filtering.h index 3f8ef26ac..7da85b940 100644 --- a/src/filtering.h +++ b/src/filtering.h @@ -1,6 +1,6 @@ /* - * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client - * Copyright (C) 1999-2012 Hiroyuki Yamamoto & The Claws Mail Team + * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client + * 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 @@ -86,6 +86,7 @@ void filteringprop_free(FilteringProp *prop); FilteringProp * filteringprop_parse(gchar **str); void filter_msginfo_move_or_delete(GSList *filtering_list, MsgInfo *info); +gboolean processing_enabled(GSList *filtering_list); gboolean filter_message_by_msginfo(GSList *flist, MsgInfo *info, PrefsAccount *ac_prefs, FilteringInvocationType context, gchar *extra_info); diff --git a/src/folder.c b/src/folder.c index b9a9c99f8..7f06d3342 100644 --- a/src/folder.c +++ b/src/folder.c @@ -1,6 +1,6 @@ /* * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client - * Copyright (C) 1999-2016 Hiroyuki Yamamoto and the Claws Mail team + * 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 @@ -4447,8 +4447,9 @@ void folder_item_apply_processing(FolderItem *item) processing_list = item->prefs->processing; - if (!pre_global_processing && !processing_list - && !post_global_processing) + if (!processing_enabled(pre_global_processing) && + !processing_enabled(processing_list) && + !processing_enabled(post_global_processing)) return; debug_print("processing %s\n", item->name);