2007-04-26 [colin] 2.9.1cvs27
authorColin Leroy <colin@colino.net>
Thu, 26 Apr 2007 17:17:39 +0000 (17:17 +0000)
committerColin Leroy <colin@colino.net>
Thu, 26 Apr 2007 17:17:39 +0000 (17:17 +0000)
* configure.ac
libetpan-0.49 is now required
* src/procmime.c
Fix double fetching of mails if
first try failed
* src/imap.c
Make offline sync faster, by
remembering last change time, and
last sync time.

ChangeLog
PATCHSETS
configure.ac
src/imap.c
src/procmime.c

index bcb0fa1..de3fcfd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2007-04-26 [colin]     2.9.1cvs27
+
+       * configure.ac
+               libetpan-0.49 is now required
+       * src/procmime.c
+               Fix double fetching of mails if
+               first try failed
+       * src/imap.c
+               Make offline sync faster, by
+               remembering last change time, and
+               last sync time.
+
 2007-04-26 [hoa]       2.9.1cvs26
 
        * src/imap.c
@@ -7,6 +19,7 @@
        * src/etpan/imap-thread.c
        * src/etpan/imap-thread.h
                cancellation of IMAP operations is now allowed.
+               Fixes bug 1056, 'Possibility to 'cancel transfer' in IMAP'
 
 2007-04-26 [colin]     2.9.1cvs25
 
index e114207..e8cfd3d 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.382.2.374 -r 1.382.2.375 src/compose.c;  ) > 2.9.1cvs24.patchset
 ( cvs diff -u -r 1.213.2.141 -r 1.213.2.142 src/folder.c;  ) > 2.9.1cvs25.patchset
 ( cvs diff -u -r 1.179.2.166 -r 1.179.2.167 src/imap.c;  cvs diff -u -r 1.34.2.14 -r 1.34.2.15 src/imap.h;  cvs diff -u -r 1.274.2.185 -r 1.274.2.186 src/mainwindow.c;  cvs diff -u -r 1.43.2.65 -r 1.43.2.66 src/toolbar.c;  cvs diff -u -r 1.1.4.77 -r 1.1.4.78 src/etpan/imap-thread.c;  cvs diff -u -r 1.1.4.14 -r 1.1.4.15 src/etpan/imap-thread.h;  ) > 2.9.1cvs26.patchset
+( cvs diff -u -r 1.654.2.2610 -r 1.654.2.2611 configure.ac;  cvs diff -u -r 1.49.2.91 -r 1.49.2.92 src/procmime.c;  cvs diff -u -r 1.179.2.167 -r 1.179.2.168 src/imap.c;  ) > 2.9.1cvs27.patchset
index 3e0e2b8..1ec5c71 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=1
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=26
+EXTRA_VERSION=27
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
@@ -805,18 +805,18 @@ if test x"$ac_cv_enable_libetpan" = xyes; then
           LIBETPAN_CPPFLAGS="`$libetpanconfig --cflags`"
           LIBETPAN_LIBS="`$libetpanconfig --libs`"
           LIBETPAN_VERSION=`$libetpanconfig --version | sed "s/\.//g" | sed "s/-.*$//"`
-          if test "$LIBETPAN_VERSION" -lt "048"; then
-               AC_MSG_RESULT([*** Claws Mail requires libetpan 0.48 or newer. See http://www.etpan.org/])
+          if test "$LIBETPAN_VERSION" -lt "049"; then
+               AC_MSG_RESULT([*** Claws Mail requires libetpan 0.49 or newer. See http://www.etpan.org/])
                AC_MSG_RESULT([*** You can use --disable-libetpan if you don't need IMAP4 support.])
-                AC_MSG_ERROR([libetpan 0.48 not found])
+                AC_MSG_ERROR([libetpan 0.49 not found])
           fi
           AC_SUBST(LIBETPAN_FLAGS)
           AC_SUBST(LIBETPAN_LIBS)
           AC_DEFINE(HAVE_LIBETPAN, 1, Define if you want IMAP support.)
        else
-          AC_MSG_RESULT([*** Claws Mail requires libetpan 0.48 or newer. See http://www.etpan.org/ ])
+          AC_MSG_RESULT([*** Claws Mail requires libetpan 0.49 or newer. See http://www.etpan.org/ ])
           AC_MSG_RESULT([*** You can use --disable-libetpan if you don't need IMAP4 support.])
-           AC_MSG_ERROR([libetpan 0.48 not found])
+           AC_MSG_ERROR([libetpan 0.49 not found])
        fi
 else
        AC_MSG_RESULT(no)
index d323c1c..543a503 100644 (file)
@@ -169,6 +169,8 @@ struct _IMAPFolderItem
 
        GHashTable *flags_set_table;
        GHashTable *flags_unset_table;
+       guint32 last_change;
+       guint32 last_sync;
 };
 
 static XMLTag *imap_item_get_xml(Folder *folder, FolderItem *item);
@@ -3534,6 +3536,7 @@ gint imap_get_num_list(Folder *folder, FolderItem *_item, GSList **msgnum_list,
                return 0;
        }
 
+       item->last_change = time(NULL);
        nummsgs = get_list_of_uids(session, folder, item, &uidlist);
 
        if (nummsgs < 0) {
@@ -3751,6 +3754,7 @@ gboolean imap_scan_required(Folder *folder, FolderItem *_item)
                if ((uid_next != item->uid_next) || (exists != item->item.total_msgs)
                    || unseen != item->item.unread_msgs || uid_val != item->item.mtime) {
                        unlock_session(session);
+                       item->last_change = time(NULL);
                        return TRUE;
                }
        }
@@ -4775,7 +4779,13 @@ gboolean imap_is_busy(Folder *folder)
 
 void imap_synchronise(FolderItem *item) 
 {
+       if (IMAP_FOLDER_ITEM(item)->last_sync == IMAP_FOLDER_ITEM(item)->last_change) {
+               debug_print("%s already synced\n", item->path?item->path:item->name);
+               return;
+       }
+       debug_print("syncing %s\n", item->path?item->path:item->name);
        imap_gtk_synchronise(item);
+       IMAP_FOLDER_ITEM(item)->last_sync = IMAP_FOLDER_ITEM(item)->last_change;
 }
 
 static void imap_item_set_xml(Folder *folder, FolderItem *item, XMLTag *tag)
@@ -4792,7 +4802,13 @@ static void imap_item_set_xml(Folder *folder, FolderItem *item, XMLTag *tag)
                if (!attr || !attr->name || !attr->value) continue;
                if (!strcmp(attr->name, "uidnext"))
                        IMAP_FOLDER_ITEM(item)->uid_next = atoi(attr->value);
+               if (!strcmp(attr->name, "last_sync"))
+                       IMAP_FOLDER_ITEM(item)->last_sync = atoi(attr->value);
+               if (!strcmp(attr->name, "last_change"))
+                       IMAP_FOLDER_ITEM(item)->last_change = atoi(attr->value);
        }
+       if (IMAP_FOLDER_ITEM(item)->last_change == 0)
+               IMAP_FOLDER_ITEM(item)->last_change = time(NULL);
 #endif
 }
 
@@ -4805,6 +4821,10 @@ static XMLTag *imap_item_get_xml(Folder *folder, FolderItem *item)
 #ifdef HAVE_LIBETPAN
        xml_tag_add_attr(tag, xml_attr_new_int("uidnext", 
                        IMAP_FOLDER_ITEM(item)->uid_next));
+       xml_tag_add_attr(tag, xml_attr_new_int("last_sync", 
+                       IMAP_FOLDER_ITEM(item)->last_sync));
+       xml_tag_add_attr(tag, xml_attr_new_int("last_change", 
+                       IMAP_FOLDER_ITEM(item)->last_change));
 
 #endif
        return tag;
index ec2c1bc..097e2e3 100644 (file)
@@ -190,10 +190,8 @@ MimeInfo *procmime_scan_message(MsgInfo *msginfo)
        filename = procmsg_get_message_file_path(msginfo);
        if (!filename || !is_file_exist(filename)) {
                g_free(filename);
-               filename = procmsg_get_message_file(msginfo);
-       }
-       if (!filename || !is_file_exist(filename)) 
                return NULL;
+       }
 
        if (!folder_has_parent_of_type(msginfo->folder, F_QUEUE) &&
            !folder_has_parent_of_type(msginfo->folder, F_DRAFT))