0.9.5claws29
authorChristoph Hohmann <reboot@gmx.ch>
Thu, 25 Sep 2003 13:01:59 +0000 (13:01 +0000)
committerChristoph Hohmann <reboot@gmx.ch>
Thu, 25 Sep 2003 13:01:59 +0000 (13:01 +0000)
* src/folder.c
        o don't fetch source message to get it's message id
        o immediately scan dest folder when copying a message did not
          return a new message number and not do it when the first message
          without a new message number is found

ChangeLog.claws
configure.ac
src/folder.c

index d16755c..b48dc87 100644 (file)
@@ -1,3 +1,11 @@
+2003-09-25 [christoph] 0.9.5claws29
+
+       * src/folder.c
+               o don't fetch source message to get it's message id
+               o immediately scan dest folder when copying a message did not
+                 return a new message number and not do it when the first message
+                 without a new message number is found
+
 2003-09-23 [christoph] 0.9.5claws28
 
        * src/compose.c
index 1edcb60..8541471 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=5
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=28
+EXTRA_VERSION=29
 if test $EXTRA_VERSION -eq 0; then
     VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}claws
 else
index c87d558..2168924 100644 (file)
@@ -1987,6 +1987,7 @@ static gint do_copy_msgs(FolderItem *dest, GSList *msglist, gboolean remove_sour
 
        relation = g_relation_new(2);
        g_relation_index(relation, 0, g_direct_hash, g_direct_equal);
+       g_relation_index(relation, 1, g_direct_hash, g_direct_equal);
 
        /* 
         * Copy messages to destination folder and 
@@ -2013,6 +2014,11 @@ static gint do_copy_msgs(FolderItem *dest, GSList *msglist, gboolean remove_sour
         * Fetch new MsgInfos for new messages in dest folder,
         * add them to the msgcache and update folder message counts
         */
+       if (g_relation_count(relation, GINT_TO_POINTER(0), 1) > 0) {
+               folder_item_scan_full(dest, FALSE);
+               folderscan = TRUE;
+       }
+
        for (l = msglist; l != NULL; l = g_slist_next(l)) {
                MsgInfo *msginfo = (MsgInfo *) l->data;
                 GTuples *tuples;
@@ -2024,32 +2030,19 @@ static gint do_copy_msgs(FolderItem *dest, GSList *msglist, gboolean remove_sour
                if (num >= 0) {
                        MsgInfo *newmsginfo;
 
-                       if (num == 0) {
-                               gchar *file;
-
-                               if (!folderscan) {
-                                       folder_item_scan_full(dest, FALSE);
-                                       folderscan = TRUE;
-                               }
-                               file = folder_item_fetch_msg(msginfo->folder, msginfo->msgnum);
-                               num = folder_item_get_msg_num_by_file(dest, file);
-                               g_free(file);
+                       if (folderscan) {
+                               newmsginfo = folder_item_get_msginfo_by_msgid(dest, msginfo->msgid);
+                               copy_msginfo_flags(msginfo, newmsginfo);
+                               num = newmsginfo->msgnum;
+                               procmsg_msginfo_free(newmsginfo);                               
+                       } else {
+                               newmsginfo = folder->klass->get_msginfo(folder, dest, num);
+                               add_msginfo_to_cache(dest, newmsginfo, msginfo);
+                               procmsg_msginfo_free(newmsginfo);
                        }
 
                        if (num > lastnum)
                                lastnum = num;
-
-                       if (num == 0)
-                               continue;
-
-                       if (!folderscan && 
-                           ((newmsginfo = folder->klass->get_msginfo(folder, dest, num)) != NULL)) {
-                               add_msginfo_to_cache(dest, newmsginfo, msginfo);
-                               procmsg_msginfo_free(newmsginfo);
-                       } else if ((newmsginfo = msgcache_get_msg(dest->cache, num)) != NULL) {
-                               copy_msginfo_flags(msginfo, newmsginfo);
-                               procmsg_msginfo_free(newmsginfo);
-                       }
                }
        }