aboutsummaryrefslogtreecommitdiffstats
path: root/libemail-engine
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2013-04-09 01:20:23 +0800
committerMilan Crha <mcrha@redhat.com>2013-04-09 01:21:04 +0800
commit2dfd548d26e179dfb12d836b57a88c215d76a926 (patch)
tree4b829ce2d938a4bb3737e0ce6c8def28497adc3c /libemail-engine
parent94372b5f1857b66d1ae7e14a37075122b5c8336c (diff)
downloadgsoc2013-evolution-2dfd548d26e179dfb12d836b57a88c215d76a926.tar.gz
gsoc2013-evolution-2dfd548d26e179dfb12d836b57a88c215d76a926.tar.zst
gsoc2013-evolution-2dfd548d26e179dfb12d836b57a88c215d76a926.zip
Bug #271262 - Allow Send/Receive of local stores in offline
Diffstat (limited to 'libemail-engine')
-rw-r--r--libemail-engine/e-mail-session-utils.c10
-rw-r--r--libemail-engine/mail-ops.c14
2 files changed, 20 insertions, 4 deletions
diff --git a/libemail-engine/e-mail-session-utils.c b/libemail-engine/e-mail-session-utils.c
index ce400c4d10..da54b7640d 100644
--- a/libemail-engine/e-mail-session-utils.c
+++ b/libemail-engine/e-mail-session-utils.c
@@ -552,6 +552,14 @@ mail_session_send_to_thread (GSimpleAsyncResult *simple,
return;
}
+ provider = camel_service_get_provider (service);
+ if ((provider->flags & CAMEL_PROVIDER_IS_REMOTE) != 0 &&
+ !camel_session_get_online (CAMEL_SESSION (session))) {
+ /* silently ignore */
+ g_object_unref (service);
+ return;
+ }
+
status = camel_service_get_connection_status (service);
if (status != CAMEL_SERVICE_CONNECTED) {
did_connect = TRUE;
@@ -566,8 +574,6 @@ mail_session_send_to_thread (GSimpleAsyncResult *simple,
}
}
- provider = camel_service_get_provider (service);
-
if (provider->flags & CAMEL_PROVIDER_DISABLE_SENT_FOLDER)
copy_to_sent = FALSE;
diff --git a/libemail-engine/mail-ops.c b/libemail-engine/mail-ops.c
index 2084aa1e01..b54ac06e23 100644
--- a/libemail-engine/mail-ops.c
+++ b/libemail-engine/mail-ops.c
@@ -242,6 +242,7 @@ fetch_mail_exec (struct _fetch_mail_msg *m,
struct _filter_mail_msg *fm = (struct _filter_mail_msg *) m;
GObjectClass *class;
CamelFolder *folder = NULL;
+ CamelProvider *provider;
CamelService *service;
CamelSession *session;
CamelSettings *settings;
@@ -258,6 +259,11 @@ fetch_mail_exec (struct _fetch_mail_msg *m,
service = CAMEL_SERVICE (m->store);
session = camel_service_ref_session (service);
+ provider = camel_service_get_provider (service);
+
+ if (provider && (provider->flags & CAMEL_PROVIDER_IS_REMOTE) != 0 &&
+ !camel_session_get_online (session))
+ goto exit;
fm->destination = e_mail_session_get_local_folder (
E_MAIL_SESSION (session), E_MAIL_LOCAL_FOLDER_LOCAL_INBOX);
@@ -265,9 +271,7 @@ fetch_mail_exec (struct _fetch_mail_msg *m,
goto exit;
g_object_ref (fm->destination);
- service = CAMEL_SERVICE (m->store);
uid = camel_service_get_uid (service);
-
settings = camel_service_ref_settings (service);
/* XXX This is a POP3-specific setting. */
@@ -703,6 +707,12 @@ mail_send_message (struct _send_queue_msg *m,
}
if (camel_address_length (recipients) > 0) {
+ if (provider && (provider->flags & CAMEL_PROVIDER_IS_REMOTE) != 0 &&
+ !camel_session_get_online (CAMEL_SESSION (m->session))) {
+ /* silently ignore */
+ goto exit;
+ }
+
if (!camel_service_connect_sync (
service, cancellable, error))
goto exit;