+2000-06-15 Dan Winship <danw@helixcode.com>
+
+ * providers/mbox/camel-mbox-folder.c (mbox_append_message): Fix to
+ previous change: make sure the "seek" variable ends up with the
+ value it should.
+
+ * providers/mbox/camel-mbox-summary.c (summary_rebuild): Update
+ summary mtime as well as size.
+
2000-06-14 Dan Winship <danw@helixcode.com>
* providers/mbox/camel-mbox-folder.c (mbox_append_message): if the
CamelStream *output_stream = NULL, *filter_stream = NULL;
CamelMimeFilter *filter_from = NULL;
struct stat st;
- off_t seek = -1;
+ off_t seek;
char *xev, last;
guint32 uid;
if (st.st_size) {
seek = camel_seekable_stream_seek((CamelSeekableStream *)output_stream, st.st_size - 1, SEEK_SET);
- if (seek != st.st_size - 1)
+ if (++seek != st.st_size)
goto fail;
/* If the mbox doesn't end with a newline, fix that. */
goto fail;
if (last != '\n')
camel_stream_write (output_stream, "\n", 1);
- }
+ } else
+ seek = 0;
/* assign a new x-evolution header/uid */
camel_medium_remove_header((CamelMedium *)message, "X-Evolution");
static int
summary_rebuild(CamelMboxSummary *mbs, off_t offset)
{
+ CamelFolderSummary *s = (CamelFolderSummary *)mbs;
CamelMimeParser *mp;
int fd;
int ok = 0;
g_assert(camel_mime_parser_step(mp, NULL, NULL) == HSCAN_FROM_END);
}
- /* update the file size in the summary */
- if (ok != -1)
- mbs->folder_size = camel_mime_parser_seek(mp, 0, SEEK_CUR);
- printf("updating folder size = %d\n", mbs->folder_size);
gtk_object_unref((GtkObject *)mp);
+ /* update the file size/mtime in the summary */
+ if (ok != -1) {
+ struct stat st;
+
+ if (stat (mbs->folder_path, &st) == 0) {
+ mbs->folder_size = st.st_size;
+ s->time = st.st_mtime;
+ }
+ }
return ok;
}