aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2012-01-31 00:05:27 +0800
committerMilan Crha <mcrha@redhat.com>2012-01-31 00:05:27 +0800
commit0ec1a44c9fabcca0b3a8d025c4caf337ae2d33af (patch)
tree150d0c969409b62f7c6d79ed4b11e4877d29897f
parent59369e6743bd5a29a61a7ec582dc33a591c665cb (diff)
downloadgsoc2013-evolution-0ec1a44c9fabcca0b3a8d025c4caf337ae2d33af.tar.gz
gsoc2013-evolution-0ec1a44c9fabcca0b3a8d025c4caf337ae2d33af.tar.zst
gsoc2013-evolution-0ec1a44c9fabcca0b3a8d025c4caf337ae2d33af.zip
Bug #669006 - Clicking "Not Junk" button should not move to next email
-rw-r--r--mail/e-mail-reader.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c
index 37c92fbf78..ef2449eb15 100644
--- a/mail/e-mail-reader.c
+++ b/mail/e-mail-reader.c
@@ -680,6 +680,16 @@ action_mail_mark_important_cb (GtkAction *action,
e_mail_reader_mark_selected (reader, mask, set);
}
+static gboolean
+is_junk_folder_selected (EMailReader *reader)
+{
+ CamelFolder *folder;
+
+ folder = e_mail_reader_get_folder (reader);
+
+ return folder && (folder->folder_flags & CAMEL_FOLDER_IS_JUNK) != 0;
+}
+
static void
action_mail_mark_junk_cb (GtkAction *action,
EMailReader *reader)
@@ -689,7 +699,8 @@ action_mail_mark_junk_cb (GtkAction *action,
guint32 set = CAMEL_MESSAGE_SEEN | CAMEL_MESSAGE_JUNK |
CAMEL_MESSAGE_JUNK_LEARN;
- if (e_mail_reader_mark_selected (reader, mask, set) == 1)
+ if (e_mail_reader_mark_selected (reader, mask, set) == 1 &&
+ !is_junk_folder_selected (reader))
e_mail_reader_select_next_message (reader, TRUE);
}
@@ -701,7 +712,8 @@ action_mail_mark_notjunk_cb (GtkAction *action,
CAMEL_MESSAGE_JUNK_LEARN;
guint32 set = CAMEL_MESSAGE_NOTJUNK | CAMEL_MESSAGE_JUNK_LEARN;
- if (e_mail_reader_mark_selected (reader, mask, set) == 1)
+ if (e_mail_reader_mark_selected (reader, mask, set) == 1 &&
+ is_junk_folder_selected (reader))
e_mail_reader_select_next_message (reader, TRUE);
}