2005-08-07 [colin] 1.9.13cvs23
authorColin Leroy <colin@colino.net>
Sun, 7 Aug 2005 13:39:27 +0000 (13:39 +0000)
committerColin Leroy <colin@colino.net>
Sun, 7 Aug 2005 13:39:27 +0000 (13:39 +0000)
* src/compose.c
* src/folder.c
* src/folder.h
* src/foldersel.c
* src/folderutils.c
* src/folderview.c
* src/imap.c
* src/mainwindow.c
* src/messageview.c
* src/mh.c
* src/msgcache.c
* src/procmime.c
* src/summaryview.c
Make subfolders of Drafts, Queue, Outbox, Trash
work like their parents.
Fixes bug #686 (Message view on Drafts/Sent should be the same on Subfolders)

16 files changed:
ChangeLog-gtk2.claws
PATCHSETS
configure.ac
src/compose.c
src/folder.c
src/folder.h
src/foldersel.c
src/folderutils.c
src/folderview.c
src/imap.c
src/mainwindow.c
src/messageview.c
src/mh.c
src/msgcache.c
src/procmime.c
src/summaryview.c

index b1f7a8a9bdf9f66916181e532ab8c9569a2e92bd..cc5d8017bd1dea707036c097dd32640fda6775ba 100644 (file)
@@ -1,3 +1,22 @@
+2005-08-07 [colin]     1.9.13cvs23
+
+       * src/compose.c
+       * src/folder.c
+       * src/folder.h
+       * src/foldersel.c
+       * src/folderutils.c
+       * src/folderview.c
+       * src/imap.c
+       * src/mainwindow.c
+       * src/messageview.c
+       * src/mh.c
+       * src/msgcache.c
+       * src/procmime.c
+       * src/summaryview.c
+               Make subfolders of Drafts, Queue, Outbox, Trash
+               work like their parents. 
+               Fixes bug #686 (Message view on Drafts/Sent should be the same on Subfolders)
+
 2005-08-07 [colin]     1.9.13cvs22
 
        * src/addressbook.c
index 9e54ac3798bf1c655944d0dcdbe5fa15368a88fd..d7a86e3d34c32acf0e35676259129bf19e04b04b 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.207.2.52 -r 1.207.2.53 src/folderview.c;  cvs diff -u -r 1.395.2.103 -r 1.395.2.104 src/summaryview.c;  ) > 1.9.13cvs20.patchset
 ( cvs diff -u -r 1.395.2.104 -r 1.395.2.105 src/summaryview.c;  ) > 1.9.13cvs21.patchset
 ( cvs diff -u -r 1.60.2.23 -r 1.60.2.24 src/addressbook.c;  ) > 1.9.13cvs22.patchset
+( cvs diff -u -r 1.382.2.148 -r 1.382.2.149 src/compose.c;  cvs diff -u -r 1.213.2.45 -r 1.213.2.46 src/folder.c;  cvs diff -u -r 1.87.2.14 -r 1.87.2.15 src/folder.h;  cvs diff -u -r 1.26.2.18 -r 1.26.2.19 src/foldersel.c;  cvs diff -u -r 1.3.2.5 -r 1.3.2.6 src/folderutils.c;  cvs diff -u -r 1.207.2.53 -r 1.207.2.54 src/folderview.c;  cvs diff -u -r 1.179.2.57 -r 1.179.2.58 src/imap.c;  cvs diff -u -r 1.274.2.52 -r 1.274.2.53 src/mainwindow.c;  cvs diff -u -r 1.94.2.60 -r 1.94.2.61 src/messageview.c;  cvs diff -u -r 1.79.2.15 -r 1.79.2.16 src/mh.c;  cvs diff -u -r 1.16.2.23 -r 1.16.2.24 src/msgcache.c;  cvs diff -u -r 1.49.2.52 -r 1.49.2.53 src/procmime.c;  cvs diff -u -r 1.395.2.105 -r 1.395.2.106 src/summaryview.c;  ) > 1.9.13cvs23.patchset
index 7aa192d7820f39d700cfd1b449f51cc9b9dc0301..d4ab51a0a291a9b14e49d9ff431a8a57bf339347 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=13
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=22
+EXTRA_VERSION=23
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index df215dafc0460ff7c84b44bbb0829b813b942a86..7cfcddac29ca34ab72cd7ed5797fd6721eb0ce25 100644 (file)
@@ -1336,7 +1336,8 @@ void compose_reedit(MsgInfo *msginfo)
        if (compose_put_existing_to_front(msginfo)) 
                return;
 
-        if (msginfo->folder->stype == F_QUEUE || msginfo->folder->stype == F_DRAFT) {
+        if (folder_has_parent_of_type(msginfo->folder, F_QUEUE) ||
+           folder_has_parent_of_type(msginfo->folder, F_DRAFT)) {
                gchar queueheader_buf[BUFFSIZE];
                gint id, param;
 
@@ -1399,8 +1400,8 @@ void compose_reedit(MsgInfo *msginfo)
        compose_use_encryption(compose, use_encryption);
        compose->targetinfo = procmsg_msginfo_copy(msginfo);
 
-        if (msginfo->folder->stype == F_QUEUE
-       ||  msginfo->folder->stype == F_DRAFT) {
+        if (folder_has_parent_of_type(msginfo->folder, F_QUEUE) ||
+           folder_has_parent_of_type(msginfo->folder, F_DRAFT)) {
                gchar queueheader_buf[BUFFSIZE];
 
                /* Set message save folder */
@@ -3852,7 +3853,8 @@ static gint compose_remove_reedit_target(Compose *compose)
        g_return_val_if_fail(item != NULL, -1);
 
        if (procmsg_msg_exist(msginfo) &&
-           (item->stype == F_DRAFT || item->stype == F_QUEUE 
+           (folder_has_parent_of_type(item, F_QUEUE) ||
+            folder_has_parent_of_type(item, F_DRAFT) 
             || msginfo == compose->autosaved_draft)) {
                if (folder_item_remove_msg(item, msginfo->msgnum) < 0) {
                        g_warning("can't remove the old message\n");
index 14acc2fd49d140eb21c141a5a7dd31b6a963b14e..a8675bdf348ada463c477a367873d48f1d5458c6 100644 (file)
@@ -1415,18 +1415,18 @@ gchar *folder_item_get_path(FolderItem *item)
 
 void folder_item_set_default_flags(FolderItem *dest, MsgFlags *flags)
 {
-       if (!(dest->stype == F_OUTBOX ||
-             dest->stype == F_QUEUE  ||
-             dest->stype == F_DRAFT  ||
-             dest->stype == F_TRASH)) {
+       if (!(folder_has_parent_of_type(dest, F_OUTBOX) ||
+             folder_has_parent_of_type(dest, F_QUEUE)  ||
+             folder_has_parent_of_type(dest, F_DRAFT) ||
+             folder_has_parent_of_type(dest, F_TRASH))) {
                flags->perm_flags = MSG_NEW|MSG_UNREAD;
        } else {
                flags->perm_flags = 0;
        }
        if (FOLDER_TYPE(dest->folder) == F_MH) {
-               if (dest->stype == F_QUEUE) {
+               if (folder_has_parent_of_type(dest, F_QUEUE)) {
                        MSG_SET_TMP_FLAGS(*flags, MSG_QUEUED);
-               } else if (dest->stype == F_DRAFT) {
+               } else if (folder_has_parent_of_type(dest, F_DRAFT)) {
                        MSG_SET_TMP_FLAGS(*flags, MSG_DRAFT);
                }
        }
@@ -1821,10 +1821,10 @@ gint folder_item_scan_full(FolderItem *item, gboolean filtering)
                        procmsg_msginfo_unset_flags(msginfo, MSG_NEW | MSG_UNREAD, 0);
                        procmsg_msginfo_set_flags(msginfo, MSG_IGNORE_THREAD, 0);
                }
-               if ((item->stype == F_OUTBOX ||
-                    item->stype == F_QUEUE  ||
-                    item->stype == F_DRAFT  ||
-                    item->stype == F_TRASH) &&
+               if ((folder_has_parent_of_type(item, F_OUTBOX) ||
+                    folder_has_parent_of_type(item, F_QUEUE)  ||
+                    folder_has_parent_of_type(item, F_DRAFT)  ||
+                    folder_has_parent_of_type(item, F_TRASH)) &&
                    (MSG_IS_NEW(msginfo->flags) || MSG_IS_UNREAD(msginfo->flags)))
                        procmsg_msginfo_unset_flags(msginfo, MSG_NEW | MSG_UNREAD, 0);
                if (MSG_IS_NEW(msginfo->flags))
@@ -2194,8 +2194,8 @@ gchar *folder_item_fetch_msg(FolderItem *item, gint num)
                if ((msginfo != NULL) && !MSG_IS_SCANNED(msginfo->flags)) {
                        MimeInfo *mimeinfo;
 
-                       if (msginfo->folder->stype != F_QUEUE && 
-                           msginfo->folder->stype != F_DRAFT)
+                       if (!folder_has_parent_of_type(msginfo->folder, F_QUEUE) && 
+                           !folder_has_parent_of_type(msginfo->folder, F_DRAFT))
                                mimeinfo = procmime_scan_file(msgfile);
                        else
                                mimeinfo = procmime_scan_queue_file(msgfile);
@@ -2235,8 +2235,8 @@ gchar *folder_item_fetch_msg_full(FolderItem *item, gint num, gboolean headers,
                if ((msginfo != NULL) && !MSG_IS_SCANNED(msginfo->flags)) {
                        MimeInfo *mimeinfo;
 
-                       if (msginfo->folder->stype != F_QUEUE && 
-                           msginfo->folder->stype != F_DRAFT)
+                       if (!folder_has_parent_of_type(msginfo->folder, F_QUEUE) &&
+                           !folder_has_parent_of_type(msginfo->folder, F_DRAFT))
                                mimeinfo = procmime_scan_file(msgfile);
                        else
                                mimeinfo = procmime_scan_queue_file(msgfile);
@@ -2320,7 +2320,8 @@ static gint folder_item_get_msg_num_by_file(FolderItem *dest, const gchar *file)
        if ((fp = fopen(file, "rb")) == NULL)
                return 0;
 
-       if ((dest->stype == F_QUEUE) || (dest->stype == F_DRAFT))
+       if ((folder_has_parent_of_type(dest, F_QUEUE)) || 
+           (folder_has_parent_of_type(msginfo->folder, F_DRAFT)))
                while (fgets(buf, sizeof(buf), fp) != NULL)
                        if (buf[0] == '\r' || buf[0] == '\n') break;
 
@@ -2359,10 +2360,10 @@ static void copy_msginfo_flags(MsgInfo *source, MsgInfo *dest)
        }
 
        /* remove new, unread and deleted in special folders */
-       if (dest->folder->stype == F_OUTBOX ||
-           dest->folder->stype == F_QUEUE  ||
-           dest->folder->stype == F_DRAFT  ||
-           dest->folder->stype == F_TRASH)
+       if (folder_has_parent_of_type(dest, F_OUTBOX) || 
+           folder_has_parent_of_type(dest, F_QUEUE) || 
+           folder_has_parent_of_type(dest, F_DRAFT) || 
+           folder_has_parent_of_type(dest, F_TRASH))
                perm_flags &= ~(MSG_NEW | MSG_UNREAD | MSG_DELETED);
 
        /* set ignore flag of ignored parent exists */
@@ -3554,4 +3555,16 @@ void folder_item_set_batch (FolderItem *item, gboolean batch)
        }
 }
 
+gboolean folder_has_parent_of_type(FolderItem *item, 
+                                         SpecialFolderItemType type) 
+{
+       FolderItem *cur = item;
+       while (cur) {
+               if (cur->stype == type)
+                       return TRUE;
+               cur = folder_item_parent(cur);
+       }
+       return FALSE;
+}
+
 #undef PUT_ESCAPE_STR
index e35e19994c227927f17c92acd0118a5cb4100d38..5534b46bea89e51ec80f356685e5ef2294ee88d8 100644 (file)
@@ -804,4 +804,5 @@ void folder_item_update_recursive   (FolderItem *item,
 void folder_item_update_freeze         (void);
 void folder_item_update_thaw           (void);
 void folder_item_set_batch             (FolderItem *item, gboolean batch);
+gboolean folder_has_parent_of_type     (FolderItem *item, SpecialFolderItemType type);
 #endif /* __FOLDER_H__ */
index 4dfedf3310bc816e198bed405236009825e682cb..765913145b4f1a515b39ee276b9793aa25b433fe 100644 (file)
@@ -386,7 +386,7 @@ static void foldersel_append_item(GtkTreeStore *store, FolderItem *item,
        }
 #endif        
 
-       if (item->stype == F_QUEUE && item->total_msgs > 0) {
+       if (folder_has_parent_of_type(item, F_QUEUE) && item->total_msgs > 0) {
                name = g_strdup_printf("%s (%d)", name, item->total_msgs);
        } else if (item->unread_msgs > 0) {
                name = g_strdup_printf("%s (%d)", name, item->unread_msgs);
@@ -397,10 +397,11 @@ static void foldersel_append_item(GtkTreeStore *store, FolderItem *item,
        pixbuf_open =
                item->no_select ? foldernoselect_pixbuf : folderopen_pixbuf;
 
-       if (item->stype == F_OUTBOX || item->stype == F_DRAFT ||
-           item->stype == F_TRASH) {
+       if (folder_has_parent_of_type(item, F_DRAFT) ||
+           folder_has_parent_of_type(item, F_OUTBOX) ||
+           folder_has_parent_of_type(item, F_TRASH)) {
                use_bold = use_color = FALSE;
-       } else if (item->stype == F_QUEUE) {
+       } else if (folder_has_parent_of_type(item, F_QUEUE)) {
                use_bold = use_color = (item->total_msgs > 0);
        } else {
                use_bold = (item->unread_msgs > 0);
index 7b8eb26284d2a0a437108c1e33e011ff3466cbd8..ebf63a54a4b07003d86e5abbd4acc348e89de35d 100644 (file)
@@ -67,7 +67,7 @@ gint folderutils_delete_duplicates(FolderItem *item,
                case DELETE_DUPLICATES_REMOVE: {
                        FolderItem *trash = item->folder->trash;
 
-                       if (item->stype == F_TRASH || trash == NULL)
+                       if (folder_has_parent_of_type(item, F_TRASH) || trash == NULL)
                                folder_item_remove_msgs(item, duplist);
                        else                    
                                folder_item_move_msgs(trash, duplist);
index fd39fea82830bbd766b25aa276c29afdcab90a06..6a139686179b3661ba5979e45fd355d722ada641 100644 (file)
@@ -1053,7 +1053,7 @@ static gboolean folderview_have_new_children_sub(FolderView *folderview,
 
        if (in_sub &&
            (item->new_msgs > 0 ||
-           (item->stype == F_QUEUE && item->total_msgs > 0))) {
+           (folder_has_parent_of_type(item, F_QUEUE) && item->total_msgs > 0))) {
                return TRUE;
        }
 
@@ -1092,7 +1092,7 @@ static gboolean folderview_have_unread_children_sub(FolderView *folderview,
 
        if (in_sub &&
            (item->unread_msgs > 0 ||
-           (item->stype == F_QUEUE && item->total_msgs > 0))) {
+           (folder_has_parent_of_type(item, F_QUEUE) && item->total_msgs > 0))) {
                return TRUE;
        }
 
@@ -1276,7 +1276,7 @@ static void folderview_update_node(FolderView *folderview, GtkCTreeNode *node)
                mask = openmask = searchmask;
        }
 
-       if (item->stype == F_QUEUE && item->total_msgs > 0 &&
+       if (folder_has_parent_of_type(item, F_QUEUE) && item->total_msgs > 0 &&
            prefs_common.display_folder_unread) {
                str = g_strdup_printf("%s (%d%s)", name, item->total_msgs,
                                      add_unread_mark ? "+" : "");
@@ -1319,10 +1319,11 @@ static void folderview_update_node(FolderView *folderview, GtkCTreeNode *node)
                gtk_ctree_node_set_text(ctree, node, col_pos[F_COL_TOTAL],  itos(item->total_msgs));
        }
 
-       if (item->stype == F_OUTBOX || item->stype == F_DRAFT ||
-           item->stype == F_TRASH) {
+       if (folder_has_parent_of_type(item, F_OUTBOX) ||
+           folder_has_parent_of_type(item, F_DRAFT) ||
+           folder_has_parent_of_type(item, F_TRASH)) {
                use_bold = use_color = FALSE;
-       } else if (item->stype == F_QUEUE) {
+       } else if (folder_has_parent_of_type(item, F_QUEUE)) {
                /* highlight queue folder if there are any messages */
                use_bold = use_color = (item->total_msgs > 0);
        } else {
index f50c54f2e3cc3a98c55c29171d0c27ec5152e0d3..418f6fdab48f45e4752ae4b63ad3278c4408f88e 100644 (file)
@@ -908,10 +908,10 @@ static gint imap_add_msgs(Folder *folder, FolderItem *dest, GSList *file_list,
                                iflags |= IMAP_FLAG_SEEN;
                }
 
-               if (dest->stype == F_OUTBOX ||
-                   dest->stype == F_QUEUE  ||
-                   dest->stype == F_DRAFT  ||
-                   dest->stype == F_TRASH)
+               if (folder_has_parent_of_type(dest, F_QUEUE) ||
+                   folder_has_parent_of_type(dest, F_OUTBOX) ||
+                   folder_has_parent_of_type(dest, F_DRAFT) ||
+                   folder_has_parent_of_type(dest, F_TRASH))
                        iflags |= IMAP_FLAG_SEEN;
 
                ok = imap_cmd_append(session, destdir, fileinfo->file, iflags, 
@@ -2902,9 +2902,9 @@ static MsgInfo *imap_parse_msg(const gchar *file, FolderItem *item)
        g_return_val_if_fail(item != NULL, NULL);
        g_return_val_if_fail(file != NULL, NULL);
 
-       if (item->stype == F_QUEUE) {
+       if (folder_has_parent_of_type(item, F_QUEUE)) {
                MSG_SET_TMP_FLAGS(flags, MSG_QUEUED);
-       } else if (item->stype == F_DRAFT) {
+       } else if (folder_has_parent_of_type(item, F_DRAFT)) {
                MSG_SET_TMP_FLAGS(flags, MSG_DRAFT);
        }
 
@@ -2939,7 +2939,8 @@ GSList *imap_get_msginfos(Folder *folder, FolderItem *item,
        if (ok != IMAP_SUCCESS)
                return NULL;
 
-       if (!(item->stype == F_QUEUE || item->stype == F_DRAFT)) {
+       if (!(folder_has_parent_of_type(item, F_DRAFT) || 
+             folder_has_parent_of_type(item, F_QUEUE))) {
                ret = g_slist_concat(ret,
                        imap_get_uncached_messages(session, item,
                                                   msgnum_list));
@@ -3715,9 +3716,9 @@ static MsgInfo *imap_envelope_from_lep(struct imap_fetch_env_info * info,
        MsgFlags flags = {0, 0};
        
        MSG_SET_TMP_FLAGS(flags, MSG_IMAP);
-       if (item->stype == F_QUEUE) {
+       if (folder_has_parent_of_type(item, F_QUEUE)) {
                MSG_SET_TMP_FLAGS(flags, MSG_QUEUED);
-       } else if (item->stype == F_DRAFT) {
+       } else if (folder_has_parent_of_type(item, F_DRAFT)) {
                MSG_SET_TMP_FLAGS(flags, MSG_DRAFT);
        }
        flags.perm_flags = info->flags;
index 550f5aa828bb4b9977ae36497e5d906806ec921e..f2add111d00f0aaafce5279dacf878d2c107fbd3 100644 (file)
@@ -1759,8 +1759,9 @@ SensitiveCond main_window_get_current_state(MainWindow *mainwin)
                state |= M_NOT_NEWS;
        if (selection == SUMMARY_SELECTED_SINGLE &&
            (item &&
-            (item->stype == F_OUTBOX || item->stype == F_DRAFT ||
-             item->stype == F_QUEUE)))
+            (folder_has_parent_of_type(item, F_DRAFT) ||
+             folder_has_parent_of_type(item, F_OUTBOX) ||
+             folder_has_parent_of_type(item, F_QUEUE))))
                state |= M_ALLOW_REEDIT;
        if (cur_account)
                state |= M_HAVE_ACCOUNT;
index 82a65cdc0d9a32db365104c6c93f0459576d2cbe..882a83047054ebdca1b089a2623658bd9ce071c2 100644 (file)
@@ -1464,9 +1464,10 @@ static void reedit_cb(gpointer data, guint action, GtkWidget *widget)
        if (!messageview->msginfo) return;
        msginfo = messageview->msginfo;
        if (!msginfo->folder) return;
-       if (msginfo->folder->stype != F_OUTBOX &&
-           msginfo->folder->stype != F_DRAFT &&
-           msginfo->folder->stype != F_QUEUE) return;
+       if (!folder_has_parent_of_type(msginfo->folder, F_DRAFT) &&
+           !folder_has_parent_of_type(msginfo->folder, F_OUTBOX) &&
+           !folder_has_parent_of_type(msginfo->folder, F_QUEUE)) 
+               return;
 
        compose_reedit(msginfo);
 }
index 2620256b35b8aa151ab6f56ee745b5a6b0a45da1..d74b242d830c2ba471c8f56418bf123ca91e9a4f 100644 (file)
--- a/src/mh.c
+++ b/src/mh.c
@@ -438,14 +438,16 @@ static gint mh_copy_msg(Folder *folder, FolderItem *dest, MsgInfo *msginfo)
        
 
        if ((MSG_IS_QUEUED(msginfo->flags) || MSG_IS_DRAFT(msginfo->flags))
-       &&  dest->stype != F_QUEUE && dest->stype != F_DRAFT) {
+       && !folder_has_parent_of_type(dest, F_QUEUE)
+       && !folder_has_parent_of_type(dest, F_DRAFT)) {
                if (procmsg_remove_special_headers(srcfile, destfile) !=0) {
                        g_free(srcfile);
                        g_free(destfile);
                        return -1;
                }
        } else if (!(MSG_IS_QUEUED(msginfo->flags) || MSG_IS_DRAFT(msginfo->flags))
-       && (dest->stype == F_QUEUE || dest->stype == F_DRAFT)) {
+       && (folder_has_parent_of_type(dest, F_QUEUE)
+        || folder_has_parent_of_type(dest, F_DRAFT))) {
                g_free(srcfile);
                g_free(destfile);
                return -1;
@@ -770,9 +772,9 @@ static MsgInfo *mh_parse_msg(const gchar *file, FolderItem *item)
        flags.perm_flags = MSG_NEW|MSG_UNREAD;
        flags.tmp_flags = 0;
 
-       if (item->stype == F_QUEUE) {
+       if (folder_has_parent_of_type(item, F_QUEUE)) {
                MSG_SET_TMP_FLAGS(flags, MSG_QUEUED);
-       } else if (item->stype == F_DRAFT) {
+       } else if (folder_has_parent_of_type(item, F_DRAFT)) {
                MSG_SET_TMP_FLAGS(flags, MSG_DRAFT);
        }
 
index 06eed7f23257836568300c245bcc89e90507fdf6..2bb0a8793286e1b5ad2f799c30397da4e31578a2 100644 (file)
@@ -449,9 +449,9 @@ MsgCache *msgcache_read_cache(FolderItem *item, const gchar *cache_file)
 
        debug_print("\tReading %sswapped message cache from %s...\n", swapping?"":"un", cache_file);
 
-       if (item->stype == F_QUEUE) {
+       if (folder_has_parent_of_type(item, F_QUEUE)) {
                tmp_flags |= MSG_QUEUED;
-       } else if (item->stype == F_DRAFT) {
+       } else if (folder_has_parent_of_type(item, F_DRAFT)) {
                tmp_flags |= MSG_DRAFT;
        }
 
index d4da691f34de88b05fe3e1fd31639c561d536f30..4d103444b2545674856cbb03c662d35ce4fc4697 100644 (file)
@@ -237,8 +237,8 @@ MimeInfo *procmime_scan_message(MsgInfo *msginfo)
        if (!filename || !is_file_exist(filename)) 
                return NULL;
 
-       if (msginfo->folder->stype != F_QUEUE && 
-           msginfo->folder->stype != F_DRAFT)
+       if (!folder_has_parent_of_type(msginfo->folder, F_QUEUE) &&
+           !folder_has_parent_of_type(msginfo->folder, F_DRAFT))
                mimeinfo = procmime_scan_file(filename);
        else
                mimeinfo = procmime_scan_queue_file(filename);
index 9cc53de5c9d3002183caf2298f11ac1dc57ba8d5..55dcb2123c1aa130d42676468cf0e0ddf3d467fa 100644 (file)
@@ -2493,9 +2493,10 @@ void summary_reedit(SummaryView *summaryview)
 
        if (!summaryview->selected) return;
        if (!summaryview->folder_item) return;
-       if (summaryview->folder_item->stype != F_OUTBOX &&
-           summaryview->folder_item->stype != F_DRAFT  &&
-           summaryview->folder_item->stype != F_QUEUE) return;
+       if (!folder_has_parent_of_type(summaryview->folder_item, F_OUTBOX)
+       &&  !folder_has_parent_of_type(summaryview->folder_item, F_DRAFT)
+       &&  !folder_has_parent_of_type(summaryview->folder_item, F_QUEUE))
+               return;
 
        msginfo = gtk_ctree_node_get_row_data(GTK_CTREE(summaryview->ctree),
                                              summaryview->selected);
@@ -2992,7 +2993,7 @@ static void summary_delete_row(SummaryView *summaryview, GtkCTreeNode *row)
        summaryview->deleted++;
 
        if (!prefs_common.immediate_exec && 
-           summaryview->folder_item->stype != F_TRASH)
+           !folder_has_parent_of_type(summaryview->folder_item, F_TRASH))
                summary_set_row_marks(summaryview, row);
 
        debug_print("Message %s/%d is set to delete\n",
@@ -3079,7 +3080,7 @@ void summary_delete(SummaryView *summaryview)
 
        summary_select_node(summaryview, node, prefs_common.always_show_msg, TRUE);
        
-       if (prefs_common.immediate_exec || item->stype == F_TRASH) {
+       if (prefs_common.immediate_exec || folder_has_parent_of_type(item, F_TRASH)) {
                summary_execute(summaryview);
                /* after deleting, the anchor may be at an invalid row
                 * so reset it to the node we found earlier */
@@ -4561,9 +4562,9 @@ static void tog_searchbar_cb(GtkWidget *w, gpointer data)
 
 static void summary_open_row(GtkSCTree *sctree, SummaryView *summaryview)
 {
-       if (summaryview->folder_item->stype == F_OUTBOX ||
-           summaryview->folder_item->stype == F_DRAFT  ||
-           summaryview->folder_item->stype == F_QUEUE)
+       if (folder_has_parent_of_type(summaryview->folder_item, F_OUTBOX)
+       ||  folder_has_parent_of_type(summaryview->folder_item, F_DRAFT)
+       ||  folder_has_parent_of_type(summaryview->folder_item, F_QUEUE))
                summary_reedit(summaryview);
        else
                summary_open_msg(summaryview);