aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2007-07-17 08:32:35 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2007-07-17 08:32:35 +0000
commitbe5af8383d84235b543960dcc9facc0d9d9b43f7 (patch)
tree4028eca2720928619ffd3fef6bc9cfece6ed0357 /src
parent437fb8bb9aab30b39c864067cc04cbeb486c83d9 (diff)
check replytarget's Message-Id when adding reply flags.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@1867 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src')
-rw-r--r--src/compose.c3
-rw-r--r--src/send_message.c22
-rw-r--r--src/send_message.h3
3 files changed, 24 insertions, 4 deletions
diff --git a/src/compose.c b/src/compose.c
index a405e61a..fa228341 100644
--- a/src/compose.c
+++ b/src/compose.c
@@ -2944,7 +2944,8 @@ static gint compose_send(Compose *compose)
}
if (compose->reply_target)
- send_message_set_reply_flag(compose->reply_target);
+ send_message_set_reply_flag(compose->reply_target,
+ compose->inreplyto);
else if (compose->forward_targets)
send_message_set_forward_flags
(compose->forward_targets);
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);
diff --git a/src/send_message.h b/src/send_message.h
index e54dff8c..7841f62e 100644
--- a/src/send_message.h
+++ b/src/send_message.h
@@ -53,7 +53,8 @@ gint send_message_queue_all (FolderItem *queue,
gboolean save_msgs,
gboolean filter_msgs);
-gint send_message_set_reply_flag (const gchar *reply_target);
+gint send_message_set_reply_flag (const gchar *reply_target,
+ const gchar *msgid);
gint send_message_set_forward_flags (const gchar *forward_targets);
#endif /* __SEND_H__ */