aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers/imap
diff options
context:
space:
mode:
Diffstat (limited to 'camel/providers/imap')
-rw-r--r--camel/providers/imap/camel-imap-command.c11
-rw-r--r--camel/providers/imap/camel-imap-folder.c19
-rw-r--r--camel/providers/imap/camel-imap-summary.h2
3 files changed, 13 insertions, 19 deletions
diff --git a/camel/providers/imap/camel-imap-command.c b/camel/providers/imap/camel-imap-command.c
index 45e5751b87..e7cfc051a5 100644
--- a/camel/providers/imap/camel-imap-command.c
+++ b/camel/providers/imap/camel-imap-command.c
@@ -99,14 +99,11 @@ camel_imap_command (CamelImapStore *store, CamelFolder *folder,
cmd = imap_command_strdup_vprintf (store, fmt, ap);
va_end (ap);
} else {
- if (store->current_folder) {
- camel_object_unref (CAMEL_OBJECT (store->current_folder));
- store->current_folder = NULL;
- }
+ camel_object_ref(folder);
+ if (store->current_folder)
+ camel_object_unref(store->current_folder);
store->current_folder = folder;
- camel_object_ref (CAMEL_OBJECT (folder));
- cmd = imap_command_strdup_printf (store, "SELECT %F",
- folder->full_name);
+ cmd = imap_command_strdup_printf (store, "SELECT %F", folder->full_name);
}
if (!imap_command_start (store, folder, cmd, ex)) {
diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c
index 5248a8ef17..838762b304 100644
--- a/camel/providers/imap/camel-imap-folder.c
+++ b/camel/providers/imap/camel-imap-folder.c
@@ -503,23 +503,18 @@ imap_refresh_info (CamelFolder *folder, CamelException *ex)
CAMEL_SERVICE_LOCK (imap_store, connect_lock);
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) {
camel_imap_folder_selected (folder, response, ex);
camel_imap_response_free (imap_store, response);
}
- return;
- }
- CAMEL_SERVICE_UNLOCK (imap_store, connect_lock);
-
- /* Otherwise, if we need a rescan, do it, and if not, just do
- * a NOOP to give the server a chance to tell us about new
- * messages.
- */
- if (imap_folder->need_rescan)
+ } else if (imap_folder->need_rescan) {
+ /* Otherwise, if we need a rescan, do it, and if not, just do
+ * a NOOP to give the server a chance to tell us about new
+ * messages.
+ */
imap_rescan (folder, camel_folder_summary_count (folder->summary), ex);
- else {
+ } 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 */
@@ -531,6 +526,8 @@ imap_refresh_info (CamelFolder *folder, CamelException *ex)
response = camel_imap_command (imap_store, folder, ex, "NOOP");
camel_imap_response_free (imap_store, response);
}
+
+ CAMEL_SERVICE_UNLOCK (imap_store, connect_lock);
}
/* Called with the store's connect_lock locked */
diff --git a/camel/providers/imap/camel-imap-summary.h b/camel/providers/imap/camel-imap-summary.h
index fc54d8d0d8..e7402aac84 100644
--- a/camel/providers/imap/camel-imap-summary.h
+++ b/camel/providers/imap/camel-imap-summary.h
@@ -37,7 +37,7 @@
CAMEL_MESSAGE_FLAGGED | \
CAMEL_MESSAGE_SEEN)
-#define CAMEL_IMAP_MESSAGE_RECENT (1 << 8)
+#define CAMEL_IMAP_MESSAGE_RECENT (1 << 17)
typedef struct _CamelImapSummaryClass CamelImapSummaryClass;