aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2010-06-08 02:16:09 +0800
committerMilan Crha <mcrha@redhat.com>2010-06-08 02:16:09 +0800
commit1837179f0253a133f9fd5636b9a4d347ba5d1201 (patch)
treeb13990f596017dfb75592443ec7fb4a482c7ccf1
parent8dff23edac3595ca9b7f11cf8b9a0662039e6eff (diff)
downloadgsoc2013-evolution-1837179f0253a133f9fd5636b9a4d347ba5d1201.tar
gsoc2013-evolution-1837179f0253a133f9fd5636b9a4d347ba5d1201.tar.gz
gsoc2013-evolution-1837179f0253a133f9fd5636b9a4d347ba5d1201.tar.bz2
gsoc2013-evolution-1837179f0253a133f9fd5636b9a4d347ba5d1201.tar.lz
gsoc2013-evolution-1837179f0253a133f9fd5636b9a4d347ba5d1201.tar.xz
gsoc2013-evolution-1837179f0253a133f9fd5636b9a4d347ba5d1201.tar.zst
gsoc2013-evolution-1837179f0253a133f9fd5636b9a4d347ba5d1201.zip
Bug #611100 - Forward-to filter stops at outbox
-rw-r--r--mail/evolution-mail.schemas.in16
-rw-r--r--mail/mail-session.c27
2 files changed, 41 insertions, 2 deletions
diff --git a/mail/evolution-mail.schemas.in b/mail/evolution-mail.schemas.in
index ad1dfdc27a..30ae3933a3 100644
--- a/mail/evolution-mail.schemas.in
+++ b/mail/evolution-mail.schemas.in
@@ -873,6 +873,22 @@
</locale>
</schema>
+ <schema>
+ <key>/schemas/apps/evolution/mail/filters/flush-outbox</key>
+ <applyto>/apps/evolution/mail/filters/flush-outbox</applyto>
+ <owner>evolution-mail</owner>
+ <type>bool</type>
+ <default>false</default>
+ <locale name="C">
+ <short>Flush Outbox after filtering</short>
+ <long>
+ Whether to flush Outbox after filtering is done. Outbox flush will happen
+ only when there was used any 'Forward to' filter action and approximately
+ one minute after the last action invocation.
+ </long>
+ </locale>
+ </schema>
+
<!-- Format settings -->
<schema>
diff --git a/mail/mail-session.c b/mail/mail-session.c
index c4e1af7294..5e52aad86c 100644
--- a/mail/mail-session.c
+++ b/mail/mail-session.c
@@ -56,6 +56,7 @@
#include "mail-config.h"
#include "mail-mt.h"
#include "mail-ops.h"
+#include "mail-send-recv.h"
#include "mail-session.h"
#include "mail-tools.h"
@@ -649,13 +650,35 @@ ms_thread_status(CamelSession *session, CamelSessionThreadMsg *msg, const gchar
printf("Thread status '%s' %d%%\n", text, pc);
}
+static gboolean
+forward_to_flush_outbox_cb (gpointer data)
+{
+ guint *preparing_flush = data;
+
+ g_return_val_if_fail (preparing_flush != NULL, FALSE);
+
+ *preparing_flush = 0;
+ mail_send ();
+
+ return FALSE;
+}
+
static void
ms_forward_to_cb (CamelFolder *folder, CamelMimeMessage *msg, CamelMessageInfo *info,
gint queued, const gchar *appended_uid, gpointer data)
{
+ static guint preparing_flush = 0;
+
camel_message_info_free (info);
- /* do not call mail send, just pile them all in the outbox */
- /* mail_send (); */
+
+ /* do not call mail send immediately, just pile them all in the outbox */
+ if (preparing_flush ||
+ gconf_client_get_bool (mail_config_get_gconf_client (), "/apps/evolution/mail/filters/flush-outbox", NULL)) {
+ if (preparing_flush)
+ g_source_remove (preparing_flush);
+
+ preparing_flush = g_timeout_add_seconds (60, forward_to_flush_outbox_cb, &preparing_flush);
+ }
}
static void