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 ce702cfa16863fcd043056ae924a869d5c1b83ca..5bcac301bf2a215a993ccd9fec91b3741b57057e 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
 2003-11-21 [christoph] 0.9.6claws85
 
        * src/mimeview.c
index 95ff0ab68a447230d465141bedacccd15ee20c27..b9f7abb9bbe1ecf00f35af2f2a70a1ff50a381f1 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=6
 INTERFACE_AGE=0
 BINARY_AGE=0
 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
 if test $EXTRA_VERSION -eq 0; then
     VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}claws
 else
index 200781fb0949d1d965c28efe9037e3799dd8f477..2eacc0230768df8a4b0f445f54acbb414fd92675 100644 (file)
@@ -738,9 +738,24 @@ void messageview_destroy(MessageView *messageview)
 void messageview_delete(MessageView *msgview)
 {
        MsgInfo *msginfo = (MsgInfo *) msgview->msginfo;
 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);
 
        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)
        g_return_if_fail(trash   != NULL);
 
        if (prefs_common.immediate_exec)