fix bug #383 'Deleting message from separate message view uses local Trash folder'
authorPaul Mangan <paul@claws-mail.org>
Fri, 21 Nov 2003 17:41:57 +0000 (17:41 +0000)
committerPaul Mangan <paul@claws-mail.org>
Fri, 21 Nov 2003 17:41:57 +0000 (17:41 +0000)
ChangeLog.claws
configure.ac
src/messageview.c

index ce702cf..5bcac30 100644 (file)
@@ -1,3 +1,9 @@
+2003-11-21 [alfons]    0.9.6claws86
+
+       * src/messageview.c
+               fix bug #383 'Deleting message from "separate message view" 
+               uses local Trash folder'
+
 2003-11-21 [christoph] 0.9.6claws85
 
        * src/mimeview.c
index 95ff0ab..b9f7abb 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=6
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=85
+EXTRA_VERSION=86
 if test $EXTRA_VERSION -eq 0; then
     VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}claws
 else
index 200781f..2eacc02 100644 (file)
@@ -738,9 +738,24 @@ void messageview_destroy(MessageView *messageview)
 void messageview_delete(MessageView *msgview)
 {
        MsgInfo *msginfo = (MsgInfo *) msgview->msginfo;
-       FolderItem *trash = folder_get_default_trash();
+       FolderItem *trash = NULL;
+       PrefsAccount *ac = NULL;
 
        g_return_if_fail(msginfo != NULL);
+
+       /* to get the trash folder, we have to choose either
+        * the folder's or account's trash default - we prefer
+        * the one in the account prefs */
+       if (msginfo->folder) {
+               if (NULL != (ac = account_find_from_item(msginfo->folder)))
+                       trash = account_get_special_folder(ac, F_TRASH);
+               if (!trash && msginfo->folder->folder)  
+                       trash = msginfo->folder->folder->trash;
+               /* if still not found, use the default */
+               if (!trash) 
+                       trash = folder_get_default_trash();
+       }       
+
        g_return_if_fail(trash   != NULL);
 
        if (prefs_common.immediate_exec)