diff options
author | Not Zed <NotZed@Ximian.com> | 2002-09-04 16:13:38 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2002-09-04 16:13:38 +0800 |
commit | a52720a9213d760bb8a9c21b354ab46de7b763dd (patch) | |
tree | 984be336497cf1bca255d02a0ea00428ed9e3924 /camel/providers/imap/camel-imap-folder.c | |
parent | d27b52023b0ed91a777bc838e4f9b898ca7e2201 (diff) | |
download | gsoc2013-evolution-a52720a9213d760bb8a9c21b354ab46de7b763dd.tar gsoc2013-evolution-a52720a9213d760bb8a9c21b354ab46de7b763dd.tar.gz gsoc2013-evolution-a52720a9213d760bb8a9c21b354ab46de7b763dd.tar.bz2 gsoc2013-evolution-a52720a9213d760bb8a9c21b354ab46de7b763dd.tar.lz gsoc2013-evolution-a52720a9213d760bb8a9c21b354ab46de7b763dd.tar.xz gsoc2013-evolution-a52720a9213d760bb8a9c21b354ab46de7b763dd.tar.zst gsoc2013-evolution-a52720a9213d760bb8a9c21b354ab46de7b763dd.zip |
clear nonfatal stuff.
2002-09-04 Not Zed <NotZed@Ximian.com>
* tests/folder/test4.c (main): clear nonfatal stuff.
* tests/folder/test6.c (main): check inbox and 'another folder'
because some servers do different things w/ inbox.
* providers/imap/camel-imap-message-cache.c
(camel_imap_message_cache_get): Dont try to open the directory
instead of an empty "" uid.
* providers/imap/camel-imap-folder.c (imap_get_message): we dont
want to g_return_if_fail, we need to set an exception and always
handle the case.
(get_message_simple): Set an exception if we get a construct
failure.
(imap_refresh_info): if we're refreshing inbox, force a reselect.
this is required for at least cryus. CHECK doesnt work either :(
* tests/lib/folders.c (test_folder_basic): for non-local stores,
the folder will have an extra ref for selection, take this into
account when checking ref leaks.
(test_folder_message_ops): Dont try to delete folder with messages
in it, it works generally with imap. also, change params so we
can test different mailbox types.
(test_folder_message_ops): disconnect remote services before
finishing off. doesn't need to stricly but makes ref count
checking more accurate.
(test_folder_message_ops): removed explicit remote sync, imap does
it itself now ...
* providers/imap/camel-imap-store.c:
(camel_imap_store_finalize): call service_disconnect, so it isn't
called later in the finalise chain, to properly cleanup on exit.
svn path=/trunk/; revision=17962
Diffstat (limited to 'camel/providers/imap/camel-imap-folder.c')
-rw-r--r-- | camel/providers/imap/camel-imap-folder.c | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c index ef5cec4656..1a2f5a79e9 100644 --- a/camel/providers/imap/camel-imap-folder.c +++ b/camel/providers/imap/camel-imap-folder.c @@ -478,9 +478,12 @@ imap_refresh_info (CamelFolder *folder, CamelException *ex) /* If the folder isn't selected, select it (which will force * a rescan if one is needed). - */ + * Also, if this is the INBOX, some servers (cryus) wont tell + * us with a NOOP of new messages, so force a reselect which + * should do it. */ CAMEL_SERVICE_LOCK (imap_store, connect_lock); - if (imap_store->current_folder != folder) { + if (imap_store->current_folder != folder + || strcasecmp(folder->full_name, "INBOX") == 0) { CAMEL_SERVICE_UNLOCK (imap_store, connect_lock); response = camel_imap_command (imap_store, folder, ex, NULL); if (response) { @@ -498,6 +501,14 @@ imap_refresh_info (CamelFolder *folder, CamelException *ex) if (imap_folder->need_rescan) imap_rescan (folder, camel_folder_summary_count (folder->summary), ex); else { +#if 0 + /* on some servers need to CHECKpoint INBOX to recieve new messages?? */ + /* rfc2060 suggests this, but havent seen a server that requires it */ + if (strcasecmp(folder->full_name, "INBOX") == 0) { + response = camel_imap_command (imap_store, folder, ex, "CHECK"); + camel_imap_response_free (imap_store, response); + } +#endif response = camel_imap_command (imap_store, folder, ex, "NOOP"); camel_imap_response_free (imap_store, response); } @@ -1853,6 +1864,8 @@ get_message_simple (CamelImapFolder *imap_folder, const char *uid, stream); camel_object_unref (CAMEL_OBJECT (stream)); if (ret == -1) { + camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE, + _("Unable to retrieve message: %s"), strerror(errno)); camel_object_unref (CAMEL_OBJECT (msg)); return NULL; } @@ -1886,7 +1899,11 @@ imap_get_message (CamelFolder *folder, const char *uid, CamelException *ex) return NULL; mi = camel_folder_summary_uid (folder->summary, uid); - g_return_val_if_fail (mi != NULL, NULL); + if (mi == NULL) { + camel_exception_setv(ex, CAMEL_EXCEPTION_FOLDER_INVALID_UID, + _("Cannot get message: %s\n %s"), uid, _("No such message")); + return NULL; + } /* If the message is small, fetch it in one piece. */ if (mi->size < IMAP_SMALL_BODY_SIZE) { |