diff options
author | Peter Williams <peterw@ximian.com> | 2002-07-25 03:37:57 +0800 |
---|---|---|
committer | Peter Williams <peterw@src.gnome.org> | 2002-07-25 03:37:57 +0800 |
commit | 86d2d39580ff3aa27f17766dd117765f4786b924 (patch) | |
tree | 07144b11fc3dcf90804e51779fc3328000a6640e /mail/mail-ops.c | |
parent | a401de9c229ea548029863b34672c34137a2ca94 (diff) | |
download | gsoc2013-evolution-86d2d39580ff3aa27f17766dd117765f4786b924.tar.gz gsoc2013-evolution-86d2d39580ff3aa27f17766dd117765f4786b924.tar.zst gsoc2013-evolution-86d2d39580ff3aa27f17766dd117765f4786b924.zip |
Call camel_session_get_service instead of camel_session_get_store, as
2002-07-23 Peter Williams <peterw@ximian.com>
* mail-ops.c (get_store_get): Call camel_session_get_service
instead of camel_session_get_store, as _get_store calls
_get_service_connected which is not what we want to do on startup.
(set_offline_do): Rework the logic here. It was failing when
trying to go online with a disco store that couldn't work offline.
* mail-folder-cache.c (mail_note_store): If we're using an offline
(well, non-online) disco store that cannot work offline, don't get
the folderinfo as that will fail.
svn path=/trunk/; revision=17576
Diffstat (limited to 'mail/mail-ops.c')
-rw-r--r-- | mail/mail-ops.c | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/mail/mail-ops.c b/mail/mail-ops.c index f5dc731dde..c3b652d6fc 100644 --- a/mail/mail-ops.c +++ b/mail/mail-ops.c @@ -1337,7 +1337,12 @@ get_store_get (struct _mail_msg *mm) { struct _get_store_msg *m = (struct _get_store_msg *)mm; - m->store = camel_session_get_store (session, m->uri, &mm->ex); + /*camel_session_get_store connects us, which we don't want to do on startup. */ + + m->store = camel_session_get_service (session, m->uri, + CAMEL_PROVIDER_STORE, + &mm->ex); + } static void @@ -2205,17 +2210,23 @@ static void set_offline_do(struct _mail_msg *mm) { struct _set_offline_msg *m = (struct _set_offline_msg *)mm; - if (!CAMEL_IS_DISCO_STORE (m->store) || - !camel_disco_store_can_work_offline (CAMEL_DISCO_STORE (m->store))) { - if (m->offline) { - camel_service_disconnect (CAMEL_SERVICE (m->store), - TRUE, &mm->ex); + if (CAMEL_IS_DISCO_STORE (m->store)) { + if (!m->offline) { + camel_disco_store_set_status (CAMEL_DISCO_STORE (m->store), + CAMEL_DISCO_STORE_ONLINE, + &mm->ex); + return; + } else if (camel_disco_store_can_work_offline (CAMEL_DISCO_STORE (m->store))) { + camel_disco_store_set_status (CAMEL_DISCO_STORE (m->store), + CAMEL_DISCO_STORE_OFFLINE, + &mm->ex); + return; } - } else { - camel_disco_store_set_status (CAMEL_DISCO_STORE (m->store), - m->offline ? CAMEL_DISCO_STORE_OFFLINE : CAMEL_DISCO_STORE_ONLINE, - &mm->ex); } + + if (m->offline) + camel_service_disconnect (CAMEL_SERVICE (m->store), + TRUE, &mm->ex); } static void set_offline_done(struct _mail_msg *mm) |