aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--src/summaryview.c17
2 files changed, 17 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index bd687891..d204a95f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-03-29
+
+ * src/summaryview.c: summary_junk(): select proper junk folder instead
+ of default one.
+
2013-03-28
* src/quote_fmt_parse.y: prohibit warnings when target message does
diff --git a/src/summaryview.c b/src/summaryview.c
index 7e8675fc..d0f35735 100644
--- a/src/summaryview.c
+++ b/src/summaryview.c
@@ -5060,22 +5060,29 @@ static void summary_not_junk_func(GtkTreeModel *model, GtkTreePath *path,
void summary_junk(SummaryView *summaryview)
{
- FolderItem *junk;
+ FolderItem *junk = NULL;
if (!prefs_common.enable_junk)
return;
if (!prefs_common.junk_learncmd)
return;
- summary_lock(summaryview);
-
- debug_print("Set mail as junk\n");
+ debug_print("summary_junk: setting selected mails as junk\n");
if (prefs_common.junk_folder)
junk = folder_find_item_from_identifier
(prefs_common.junk_folder);
- else
+ if (!junk &&
+ summaryview->folder_item && summaryview->folder_item->folder)
+ junk = folder_get_junk(summaryview->folder_item->folder);
+ if (!junk)
junk = folder_get_default_junk();
+ if (!junk) {
+ g_warning("summary_junk: junk folder not found");
+ return;
+ }
+
+ summary_lock(summaryview);
summaryview->to_folder = junk;
gtk_tree_selection_selected_foreach(summaryview->selection,