camel-imap4 r13 - trunk/imap4



Author: fejj
Date: Thu May 15 01:47:17 2008
New Revision: 13
URL: http://svn.gnome.org/viewvc/camel-imap4?rev=13&view=rev

Log:
2008-05-14  Jeffrey Stedfast  <fejj novell com>

	* camel-imap4-folder.c (imap4_getv): Implement support for getting
	the cache's expire settings.
	(imap4_setv): Added support for setting the cache's expire
	settings.
	(camel_imap4_folder_new): Default enable_mlist to FALSE now that
	we always fetch at least List-Id.

	* camel-imap4-summary.c: Include "List-Id" in the base
	headers. This means that enable_mlist now only means that the
	extended list of Mailing-List headers should be fetched. We assume
	that List-Id should be enough for most users.



Modified:
   trunk/imap4/ChangeLog
   trunk/imap4/camel-imap4-folder.c
   trunk/imap4/camel-imap4-folder.h
   trunk/imap4/camel-imap4-summary.c

Modified: trunk/imap4/camel-imap4-folder.c
==============================================================================
--- trunk/imap4/camel-imap4-folder.c	(original)
+++ trunk/imap4/camel-imap4-folder.c	Thu May 15 01:47:17 2008
@@ -86,7 +86,9 @@
 static GSList *imap4_folder_props = NULL;
 
 static CamelProperty imap4_prop_list[] = {
-	{ CAMEL_IMAP4_FOLDER_ENABLE_MLIST, "mlist_info", N_("Enable Mailing-List detection required for some filter and vFolder rules") },
+	{ CAMEL_IMAP4_FOLDER_ENABLE_MLIST, "mlist_info", N_("Enable extended Mailing-List detection required for some filter and vFolder rules") },
+	{ CAMEL_IMAP4_FOLDER_EXPIRE_ACCESS, "expire-access", N_("Expire cached messages that haven't been read in X seconds") },
+	{ CAMEL_IMAP4_FOLDER_EXPIRE_AGE, "expire-age", N_("Expire cached messages older than X seconds") },
 };
 
 
@@ -157,8 +159,7 @@
 	
 	camel_object_unref (folder->search);
 	
-	if (folder->cache)
-		camel_object_unref (folder->cache);
+	camel_object_unref (folder->cache);
 	
 	if (folder->journal) {
 		camel_offline_journal_write (folder->journal, NULL);
@@ -172,6 +173,7 @@
 static int
 imap4_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args)
 {
+	CamelIMAP4Folder *folder = (CamelIMAP4Folder *) object;
 	CamelArgGetV props;
 	int i, count = 0;
 	guint32 tag;
@@ -190,7 +192,13 @@
 			*arg->ca_ptr = g_slist_concat (*arg->ca_ptr, g_slist_copy (imap4_folder_props));
 			break;
 		case CAMEL_IMAP4_FOLDER_ARG_ENABLE_MLIST:
-			*arg->ca_int = ((CamelIMAP4Folder *) object)->enable_mlist;
+			*arg->ca_int = folder->enable_mlist;
+			break;
+		case CAMEL_IMAP4_FOLDER_ARG_EXPIRE_ACCESS:
+			*arg->ca_int = folder->cache->expire_access;
+			break;
+		case CAMEL_IMAP4_FOLDER_ARG_EXPIRE_AGE:
+			*arg->ca_int = folder->cache->expire_age;
 			break;
 		default:
 			count++;
@@ -210,6 +218,7 @@
 imap4_setv (CamelObject *object, CamelException *ex, CamelArgV *args)
 {
 	CamelIMAP4Folder *folder = (CamelIMAP4Folder *) object;
+	CamelDataCache *cache = folder->cache;
 	gboolean save = FALSE;
 	guint32 tag;
 	int i;
@@ -226,6 +235,18 @@
 				save = TRUE;
 			}
 			break;
+		case CAMEL_IMAP4_FOLDER_ARG_EXPIRE_ACCESS:
+			if (cache->expire_access != (time_t) arg->ca_int) {
+				camel_data_cache_set_expire_access (cache, (time_t) arg->ca_int);
+				save = TRUE;
+			}
+			break;
+		case CAMEL_IMAP4_FOLDER_ARG_EXPIRE_AGE:
+			if (cache->expire_age != (time_t) arg->ca_int) {
+				camel_data_cache_set_expire_age (cache, (time_t) arg->ca_int);
+				save = TRUE;
+			}
+			break;
 		default:
 			continue;
 		}
@@ -367,7 +388,7 @@
 	
 	if (camel_object_state_read (folder) == -1) {
 		/* set our defaults */
-		imap4_folder->enable_mlist = TRUE;
+		imap4_folder->enable_mlist = FALSE;
 	}
 	
 	if (!g_ascii_strcasecmp (full_name, "INBOX")) {

Modified: trunk/imap4/camel-imap4-folder.h
==============================================================================
--- trunk/imap4/camel-imap4-folder.h	(original)
+++ trunk/imap4/camel-imap4-folder.h	Thu May 15 01:47:17 2008
@@ -45,11 +45,15 @@
 
 enum {
 	CAMEL_IMAP4_FOLDER_ARG_ENABLE_MLIST = CAMEL_OFFLINE_FOLDER_ARG_LAST,
+	CAMEL_IMAP4_FOLDER_ARG_EXPIRE_ACCESS,
+	CAMEL_IMAP4_FOLDER_ARG_EXPIRE_AGE,
 	CAMEL_IMAP4_FOLDER_ARG_LAST = CAMEL_OFFLINE_FOLDER_ARG_LAST + 0x100
 };
 
 enum {
 	CAMEL_IMAP4_FOLDER_ENABLE_MLIST = CAMEL_IMAP4_FOLDER_ARG_ENABLE_MLIST | CAMEL_ARG_BOO,
+	CAMEL_IMAP4_FOLDER_EXPIRE_ACCESS = CAMEL_IMAP4_FOLDER_ARG_EXPIRE_ACCESS | CAMEL_ARG_INT,
+	CAMEL_IMAP4_FOLDER_EXPIRE_AGE = CAMEL_IMAP4_FOLDER_ARG_EXPIRE_AGE | CAMEL_ARG_INT,
 };
 
 struct _CamelIMAP4Folder {

Modified: trunk/imap4/camel-imap4-summary.c
==============================================================================
--- trunk/imap4/camel-imap4-summary.c	(original)
+++ trunk/imap4/camel-imap4-summary.c	Thu May 15 01:47:17 2008
@@ -123,8 +123,6 @@
 	folder_summary->message_info_size = sizeof (CamelIMAP4MessageInfo);
 	folder_summary->content_info_size = sizeof (CamelIMAP4MessageContentInfo);
 	
-	((CamelFolderSummary *) summary)->flags |= CAMEL_IMAP4_SUMMARY_HAVE_MLIST;
-	
 	summary->update_flags = TRUE;
 	summary->uidvalidity_changed = FALSE;
 }
@@ -1181,9 +1179,9 @@
 }
 
 #define IMAP4_ALL "FLAGS INTERNALDATE RFC822.SIZE ENVELOPE"
-#define MAILING_LIST_HEADERS "List-Post List-Id Mailing-List Originator X-Mailing-List X-Loop X-List Sender Delivered-To Return-Path X-BeenThere List-Unsubscribe"
+#define MAILING_LIST_HEADERS "List-Post Mailing-List Originator X-Mailing-List X-Loop X-List Sender Delivered-To Return-Path X-BeenThere List-Unsubscribe"
 
-#define BASE_HEADER_FIELDS "Content-Type References In-Reply-To"
+#define BASE_HEADER_FIELDS "Content-Type References In-Reply-To List-Id"
 #define MORE_HEADER_FIELDS BASE_HEADER_FIELDS " " MAILING_LIST_HEADERS
 
 static void



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]