From be5af8383d84235b543960dcc9facc0d9d9b43f7 Mon Sep 17 00:00:00 2001 From: hiro Date: Tue, 17 Jul 2007 08:32:35 +0000 Subject: check replytarget's Message-Id when adding reply flags. git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@1867 ee746299-78ed-0310-b773-934348b2243d --- src/send_message.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'src/send_message.c') diff --git a/src/send_message.c b/src/send_message.c index 486d659c..a0c93c94 100644 --- a/src/send_message.c +++ b/src/send_message.c @@ -355,7 +355,8 @@ gint send_message_queue_all(FolderItem *queue, gboolean save_msgs, } if (qinfo->reply_target) - send_message_set_reply_flag(qinfo->reply_target); + send_message_set_reply_flag(qinfo->reply_target, + msginfo->inreplyto); else if (qinfo->forward_targets) send_message_set_forward_flags(qinfo->forward_targets); @@ -407,7 +408,7 @@ gint send_message_queue_all(FolderItem *queue, gboolean save_msgs, return ret; } -gint send_message_set_reply_flag(const gchar *target) +gint send_message_set_reply_flag(const gchar *target, const gchar *msgid) { FolderItem *item; gint num; @@ -416,6 +417,9 @@ gint send_message_set_reply_flag(const gchar *target) g_return_val_if_fail(target != NULL, -1); + debug_print("send_message_set_reply_flag(): " + "setting reply flag to: %s\n", target); + summaryview = main_window_get()->summaryview; item = folder_find_item_and_num_from_id(target, &num); @@ -425,6 +429,11 @@ gint send_message_set_reply_flag(const gchar *target) if (summaryview->folder_item == item) { msginfo = summary_get_msginfo_by_msgnum(summaryview, num); if (msginfo) { + if (msgid && strcmp2(msgid, msginfo->msgid) != 0) { + debug_print("send_message_set_reply_flag(): " + "message-id mismatch\n"); + return -1; + } MSG_UNSET_PERM_FLAGS(msginfo->flags, MSG_FORWARDED); MSG_SET_PERM_FLAGS(msginfo->flags, MSG_REPLIED); MSG_SET_TMP_FLAGS(msginfo->flags, MSG_FLAG_CHANGED); @@ -437,6 +446,12 @@ gint send_message_set_reply_flag(const gchar *target) } else { msginfo = procmsg_get_msginfo(item, num); if (msginfo) { + if (msgid && strcmp2(msgid, msginfo->msgid) != 0) { + debug_print("send_message_set_reply_flag(): " + "message-id mismatch\n"); + procmsg_msginfo_free(msginfo); + return -1; + } MSG_UNSET_PERM_FLAGS(msginfo->flags, MSG_FORWARDED); MSG_SET_PERM_FLAGS(msginfo->flags, MSG_REPLIED); MSG_SET_TMP_FLAGS(msginfo->flags, MSG_FLAG_CHANGED); @@ -465,6 +480,9 @@ gint send_message_set_forward_flags(const gchar *targets) g_return_val_if_fail(targets != NULL, -1); + debug_print("send_message_set_forward_flags(): " + "setting forward flags to: %s\n", targets); + summaryview = main_window_get()->summaryview; paths = g_strsplit(targets, "\n", 0); -- cgit v1.2.3