From 0baca0ed0f6ee9f84affb7ac71e5b5e96967b4b8 Mon Sep 17 00:00:00 2001 From: Fabrice Bellet Date: Wed, 28 Jun 2017 21:37:43 +0200 Subject: [PATCH] flags: update the hdr message last this allow the color of the message of a colapsed thread to reflect changes that occured in the subthread, and commited by this depth first search. --- flags.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/flags.c b/flags.c index 30a94b699..218cabbbc 100644 --- a/flags.c +++ b/flags.c @@ -345,15 +345,15 @@ int mutt_thread_set_flag(struct Header *hdr, int flag, int bf, int subthread) cur = cur->parent; start = cur; - if (cur->message) + if (cur->message && cur != hdr->thread) mutt_set_flag(Context, cur->message, flag, bf); if ((cur = cur->child) == NULL) - return 0; + goto done; while (true) { - if (cur->message) + if (cur->message && cur != hdr->thread) mutt_set_flag(Context, cur->message, flag, bf); if (cur->child) @@ -366,12 +366,16 @@ int mutt_thread_set_flag(struct Header *hdr, int flag, int bf, int subthread) { cur = cur->parent; if (cur == start) - return 0; + goto done; } cur = cur->next; } } - /* not reached */ +done: + cur = hdr->thread; + if (cur->message) + mutt_set_flag(Context, cur->message, flag, bf); + return 0; } int mutt_change_flag(struct Header *h, int bf) -- 2.40.0