talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit 0b7583815089737f643414c7ad585c86b16d71ec
parent 7c26149b4d595af1c428a8e2a1c3623556a4b6ed
Author: Olivier Brunel <jjk@jjacky.com>
Date:   Wed, 27 Dec 2017 21:59:40 +0100

Preserve flags & tags when re-editing a message

When re-editing a message, let's preserve its flags (color labels, etc)
and tags. Can be especially useful for those who use such things on queued
messages, and find themselves re-editing messages afterwards but before
actually sending them.

Diffstat:
Msrc/compose.c | 15+++++++++++++++
1 file changed, 15 insertions(+), 0 deletions(-)

diff --git a/src/compose.c b/src/compose.c @@ -2366,6 +2366,7 @@ Compose *compose_reedit(MsgInfo *msginfo, gboolean batch) } compose->targetinfo = procmsg_msginfo_copy(msginfo); + compose->targetinfo->tags = g_slist_copy(msginfo->tags); compose_extract_original_charset(compose); @@ -6300,6 +6301,20 @@ static ComposeQueueResult compose_queue_sub(Compose *compose, gint *msgnum, Fold } else *msgpath = tmp; + if (compose->mode == COMPOSE_REEDIT && compose->targetinfo) { + MsgInfo *mi = folder_item_get_msginfo(queue, num); + if (mi) { + procmsg_msginfo_change_flags(mi, + compose->targetinfo->flags.perm_flags, + compose->targetinfo->flags.tmp_flags & ~(MSG_COPY | MSG_MOVE | MSG_MOVE_DONE), + 0, 0); + + g_slist_free(mi->tags); + mi->tags = g_slist_copy(compose->targetinfo->tags); + procmsg_msginfo_free(&mi); + } + } + if (compose->mode == COMPOSE_REEDIT && remove_reedit_target) { compose_remove_reedit_target(compose, FALSE); }