aboutsummaryrefslogtreecommitdiffstats
path: root/camel
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2004-03-17 17:23:49 +0800
committerMichael Zucci <zucchi@src.gnome.org>2004-03-17 17:23:49 +0800
commitbc5fc28e5b2e3602b186ee430d45c48c919ae9da (patch)
treeaac73e0cd1cac5beaf610e49773fd4fac98a4a5f /camel
parentcf4811b131d3d791da98de338a477a452663d183 (diff)
downloadgsoc2013-evolution-bc5fc28e5b2e3602b186ee430d45c48c919ae9da.tar.gz
gsoc2013-evolution-bc5fc28e5b2e3602b186ee430d45c48c919ae9da.tar.zst
gsoc2013-evolution-bc5fc28e5b2e3602b186ee430d45c48c919ae9da.zip
See bug #55618.
2004-03-17 Not Zed <NotZed@Ximian.com> * See bug #55618. * camel-disco-diary.c (camel_disco_diary_new): seek to the end of the file after we open it. c99 apparently says the file merely adds to the end of the file when you write, not that it is opened and positioned at the end of the file (linux's man pages are out of date). * camel-folder-summary.c (content_info_new): setup the content type as well, from the headers. * providers/imap/camel-imap-summary.c (camel_imap_summary_add_offline): copy size from the source info. svn path=/trunk/; revision=25096
Diffstat (limited to 'camel')
-rw-r--r--camel/ChangeLog16
-rw-r--r--camel/camel-disco-diary.c29
-rw-r--r--camel/camel-disco-store.c5
-rw-r--r--camel/camel-folder-summary.c3
-rw-r--r--camel/providers/imap/camel-imap-summary.c2
5 files changed, 54 insertions, 1 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 388c9c4130..7e93eac944 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,3 +1,19 @@
+2004-03-17 Not Zed <NotZed@Ximian.com>
+
+ * See bug #55618.
+
+ * camel-disco-diary.c (camel_disco_diary_new): seek to the end of
+ the file after we open it. c99 apparently says the file merely
+ adds to the end of the file when you write, not that it is opened
+ and positioned at the end of the file (linux's man pages are out
+ of date).
+
+ * camel-folder-summary.c (content_info_new): setup the content
+ type as well, from the headers.
+
+ * providers/imap/camel-imap-summary.c
+ (camel_imap_summary_add_offline): copy size from the source info.
+
2004-03-15 Jeffrey Stedfast <fejj@ximian.com>
* camel-folder.c (folder_rename): Always use '/' to derive the
diff --git a/camel/camel-disco-diary.c b/camel/camel-disco-diary.c
index 927a97f432..5080ddea8e 100644
--- a/camel/camel-disco-diary.c
+++ b/camel/camel-disco-diary.c
@@ -39,6 +39,7 @@
#include "camel-session.h"
#include "camel-store.h"
+#define d(x)
static void
camel_disco_diary_class_init (CamelDiscoDiaryClass *camel_disco_diary_class)
@@ -119,6 +120,8 @@ camel_disco_diary_log (CamelDiscoDiary *diary, CamelDiscoDiaryAction action,
va_list ap;
int status;
+ d(printf("diary log: %s\n", diary->file?"ok":"no file!"));
+
/* You may already be a loser. */
if (!diary->file)
return;
@@ -134,6 +137,8 @@ camel_disco_diary_log (CamelDiscoDiary *diary, CamelDiscoDiaryAction action,
CamelFolder *folder = va_arg (ap, CamelFolder *);
GPtrArray *uids = va_arg (ap, GPtrArray *);
+ d(printf(" folder expunge '%s'\n", folder->full_name));
+
status = camel_file_util_encode_string (diary->file, folder->full_name);
if (status != -1)
status = diary_encode_uids (diary, uids);
@@ -145,6 +150,8 @@ camel_disco_diary_log (CamelDiscoDiary *diary, CamelDiscoDiaryAction action,
CamelFolder *folder = va_arg (ap, CamelFolder *);
char *uid = va_arg (ap, char *);
+ d(printf(" folder append '%s'\n", folder->full_name));
+
status = camel_file_util_encode_string (diary->file, folder->full_name);
if (status != -1)
status = camel_file_util_encode_string (diary->file, uid);
@@ -158,6 +165,8 @@ camel_disco_diary_log (CamelDiscoDiary *diary, CamelDiscoDiaryAction action,
GPtrArray *uids = va_arg (ap, GPtrArray *);
gboolean delete_originals = va_arg (ap, gboolean);
+ d(printf(" folder transfer '%s' to '%s'\n", source->full_name, destination->full_name));
+
status = camel_file_util_encode_string (diary->file, source->full_name);
if (status == -1)
break;
@@ -274,6 +283,8 @@ camel_disco_diary_replay (CamelDiscoDiary *diary, CamelException *ex)
off_t size;
double pc;
+ d(printf("disco diary replay\n"));
+
fseek (diary->file, 0, SEEK_END);
size = ftell (diary->file);
g_return_if_fail (size != 0);
@@ -403,6 +414,20 @@ camel_disco_diary_new (CamelDiscoStore *store, const char *filename, CamelExcept
diary = CAMEL_DISCO_DIARY (camel_object_new (CAMEL_DISCO_DIARY_TYPE));
diary->store = store;
+ d(printf("diary log file '%s'\n", filename));
+
+ /* Note that the linux man page says:
+
+ a+ Open for reading and appending (writing at end of file). The
+ file is created if it does not exist. The stream is positioned
+ at the end of the file.
+ However, c99 (which glibc uses?) says:
+ a+ append; open or create text file for update, writing at
+ end-of-file
+
+ So we must seek ourselves.
+ */
+
diary->file = fopen (filename, "a+");
if (!diary->file) {
camel_object_unref (diary);
@@ -412,6 +437,10 @@ camel_disco_diary_new (CamelDiscoStore *store, const char *filename, CamelExcept
return NULL;
}
+ fseek(diary->file, 0, SEEK_END);
+
+ d(printf(" is at %ld\n", ftell(diary->file)));
+
return diary;
}
diff --git a/camel/camel-disco-store.c b/camel/camel-disco-store.c
index 65cbc16194..02ac74cd3f 100644
--- a/camel/camel-disco-store.c
+++ b/camel/camel-disco-store.c
@@ -32,6 +32,8 @@
#include "camel-exception.h"
#include "camel-session.h"
+#define d(x)
+
#define CDS_CLASS(o) (CAMEL_DISCO_STORE_CLASS (CAMEL_OBJECT_GET_CLASS (o)))
static CamelStoreClass *parent_class = NULL;
@@ -154,6 +156,7 @@ disco_connect (CamelService *service, CamelException *ex)
case CAMEL_DISCO_STORE_RESYNCING:
if (!CDS_CLASS (service)->connect_online (service, ex))
return FALSE;
+ d(printf(" diary is %s\n", camel_disco_diary_empty(store->diary)?"empty":"not empty"));
if (camel_disco_diary_empty (store->diary))
return TRUE;
@@ -322,6 +325,8 @@ camel_disco_store_set_status (CamelDiscoStore *store,
CamelDiscoStoreStatus status,
CamelException *ex)
{
+ d(printf("disco store set status: %s\n", status == CAMEL_DISCO_STORE_ONLINE?"online":"offline"));
+
CDS_CLASS (store)->set_status (store, status, ex);
}
diff --git a/camel/camel-folder-summary.c b/camel/camel-folder-summary.c
index fec5c67a86..2ecf0a2603 100644
--- a/camel/camel-folder-summary.c
+++ b/camel/camel-folder-summary.c
@@ -1914,7 +1914,8 @@ content_info_new (CamelFolderSummary *s, struct _camel_header_raw *h)
ci->id = camel_header_msgid_decode (camel_header_raw_find (&h, "content-id", NULL));
ci->description = camel_header_decode_string (camel_header_raw_find (&h, "content-description", NULL), NULL);
ci->encoding = camel_content_transfer_encoding_decode (camel_header_raw_find (&h, "content-transfer-encoding", NULL));
-
+ ci->type = camel_content_type_decode(camel_header_raw_find(&h, "content-type", NULL));
+
return ci;
}
diff --git a/camel/providers/imap/camel-imap-summary.c b/camel/providers/imap/camel-imap-summary.c
index bebc672866..6251f8b85b 100644
--- a/camel/providers/imap/camel-imap-summary.c
+++ b/camel/providers/imap/camel-imap-summary.c
@@ -238,6 +238,8 @@ camel_imap_summary_add_offline (CamelFolderSummary *summary, const char *uid,
tag = tag->next;
}
+ mi->size = info->size;
+
/* Set uid and add to summary */
camel_message_info_set_uid (mi, g_strdup (uid));
camel_folder_summary_add (summary, mi);