2006-06-19 [colin] 2.3.0cvs23
authorColin Leroy <colin@colino.net>
Mon, 19 Jun 2006 18:42:26 +0000 (18:42 +0000)
committerColin Leroy <colin@colino.net>
Mon, 19 Jun 2006 18:42:26 +0000 (18:42 +0000)
* src/compose.c
* src/imap.c
* src/etpan/imap-thread.c
Probably fix bug #972 (Freezes when adding
an attachment to the message)
* src/common/defs.h
Modernize Firefox cmd

ChangeLog
PATCHSETS
configure.ac
src/common/defs.h
src/compose.c
src/etpan/imap-thread.c
src/imap.c

index 26c185d..ae12fe9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2006-06-19 [colin]     2.3.0cvs23
+
+       * src/compose.c
+       * src/imap.c
+       * src/etpan/imap-thread.c
+               Probably fix bug #972 (Freezes when adding 
+               an attachment to the message)
+       * src/common/defs.h
+               Modernize Firefox cmd
+
+
 2006-06-18 [colin]     2.3.0cvs22
 
        * src/prefs_customheader.c
index fe9d510..c62b070 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.79.2.35 -r 1.79.2.36 src/mh.c;  ) > 2.3.0cvs20.patchset
 ( cvs diff -u -r 1.16.2.19 -r 1.16.2.20 src/prefs_customheader.c;  ) > 2.3.0cvs21.patchset
 ( cvs diff -u -r 1.16.2.20 -r 1.16.2.21 src/prefs_customheader.c;  ) > 2.3.0cvs22.patchset
+( cvs diff -u -r 1.382.2.279 -r 1.382.2.280 src/compose.c;  cvs diff -u -r 1.179.2.120 -r 1.179.2.121 src/imap.c;  cvs diff -u -r 1.9.2.25 -r 1.9.2.26 src/common/defs.h;  cvs diff -u -r 1.1.4.40 -r 1.1.4.41 src/etpan/imap-thread.c;  ) > 2.3.0cvs23.patchset
index d9ca569..de3365e 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=3
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=22
+EXTRA_VERSION=23
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index c1dc438..77c527f 100644 (file)
 /* #define DEFAULT_INC_PATH    "/usr/bin/imget" */
 /* #define DEFAULT_INC_PROGRAM "imget" */
 #define DEFAULT_SENDMAIL_CMD   "/usr/sbin/sendmail -t -i"
-#define DEFAULT_BROWSER_CMD    "mozilla-firefox -remote 'openURL(%s,new-window)'"
-#define DEFAULT_EDITOR_CMD     "gedit %s"
+#define DEFAULT_BROWSER_CMD    "firefox '%s'"
+#define DEFAULT_EDITOR_CMD     "gedit '%s'"
 #define DEFAULT_MIME_CMD       "metamail -d -b -x -c %s '%s'"
 #define DEFAULT_IMAGE_VIEWER_CMD "display '%s'"
 #define DEFAULT_AUDIO_PLAYER_CMD "play '%s'"
index 2d79c61..723d228 100644 (file)
@@ -7623,7 +7623,6 @@ static void compose_draft_cb(gpointer data, guint action, GtkWidget *widget)
                goto unlock;
        }
        g_free(tmp);
-       draft->mtime = 0;       /* force updating */
 
        if (compose->mode == COMPOSE_REEDIT) {
                compose_remove_reedit_target(compose, TRUE);
index 9d636d6..f3d0d19 100644 (file)
@@ -105,6 +105,40 @@ void imap_logger_fetch(int direction, const char * str, size_t size)
        free(buf);
 }
 
+void imap_logger_append(int direction, const char * str, size_t size) 
+{
+       gchar *buf;
+       gchar **lines;
+       int i = 0;
+
+       buf = malloc(size+1);
+       memset(buf, 0, size+1);
+       strncpy(buf, str, size);
+       buf[size] = '\0';
+       if (!strncmp(buf, "<<<<<<<", 7) 
+       ||  !strncmp(buf, ">>>>>>>", 7)) {
+               free(buf);
+               return;
+       }
+       while (strstr(buf, "\r"))
+               *strstr(buf, "\r") = ' ';
+       while (strlen(buf) > 0 && buf[strlen(buf)-1] == '\n')
+               buf[strlen(buf)-1] = '\0';
+
+       lines = g_strsplit(buf, "\n", -1);
+
+       if (direction == 0 || (buf[0] == '*' && buf[1] == ' ') || size < 32) {
+               while (lines[i] && *lines[i]) {
+                       log_print("IMAP4%c %s\n", direction?'>':'<', lines[i]);
+                       i++;
+               }
+       } else {
+               log_print("IMAP4%c [data - %zd bytes]\n", direction?'>':'<', size);
+       }
+       g_strfreev(lines);
+       free(buf);
+}
+
 #define ETPAN_DEFAULT_NETWORK_TIMEOUT 60
 static gboolean etpan_skip_ssl_cert_check = FALSE;
 
@@ -2137,9 +2171,13 @@ static void append_run(struct etpan_thread_op * op)
                return;
        }
        
+       mailstream_logger = imap_logger_append;
+       
        r = mailimap_append(param->imap, param->mailbox,
                            param->flag_list, NULL,
                            data, size/*, &uid */);
+
+       mailstream_logger = imap_logger_cmd;
        
        munmap(data, size);
        close(fd);
index 7ded573..fb7c845 100644 (file)
@@ -958,10 +958,10 @@ static gchar *imap_fetch_msg_full(Folder *folder, FolderItem *item, gint uid,
 
                if (cached)
                        debug_print("message %d has been already %scached (%d/%d).\n", uid,
-                               have_size == cached->size ? "fully ":"",
+                               have_size >= cached->size ? "fully ":"",
                                have_size, (int)cached->size);
                
-               if (cached && (cached->size == have_size || !body)) {
+               if (cached && (cached->size <= have_size || !body)) {
                        procmsg_msginfo_free(cached);
                        procmsg_msginfo_free(msginfo);
                        file_strip_crs(filename);
@@ -1120,8 +1120,9 @@ static gint imap_add_msgs(Folder *folder, FolderItem *dest, GSList *file_list,
                if (new_uid == 0) {
                        new_uid = dest->last_num+1;
                }
-               if (last_uid < new_uid)
+               if (last_uid < new_uid) {
                        last_uid = new_uid;
+               }
 
                g_free(real_file);
        }
@@ -3144,7 +3145,8 @@ gint imap_get_num_list(Folder *folder, FolderItem *_item, GSList **msgnum_list,
                else {
                        *old_uids_valid = FALSE;
 
-                       debug_print("Freeing imap uid cache\n");
+                       debug_print("Freeing imap uid cache (%d != %d)\n",
+                                       item->item.mtime, uid_val);
                        item->lastuid = 0;
                        g_slist_free(item->uid_list);
                        item->uid_list = NULL;