From 815b5833cc16c2c342aec88e0d33ce2ef0a36a91 Mon Sep 17 00:00:00 2001 From: Not Zed Date: Wed, 23 Feb 2005 06:14:21 +0000 Subject: ** See bug #35219 2005-02-21 Not Zed ** See bug #35219 * em-utils.c (em_utils_flag_for_followup_clear): clear the flag tags rather than setting them to "". Also change to using newer messageinfo api. (tag_editor_response, em_utils_flag_for_followup) (em_utils_flag_for_followup_completed): some cleanup/api stuff. svn path=/trunk/; revision=28858 --- mail/ChangeLog | 10 ++++++++++ mail/em-utils.c | 48 ++++++++++++++++++++++++++++++++---------------- 2 files changed, 42 insertions(+), 16 deletions(-) (limited to 'mail') diff --git a/mail/ChangeLog b/mail/ChangeLog index 6e49d73270..65a21b4c2f 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,13 @@ +2005-02-21 Not Zed + + ** See bug #35219 + + * em-utils.c (em_utils_flag_for_followup_clear): clear the flag + tags rather than setting them to "". Also change to using newer + messageinfo api. + (tag_editor_response, em_utils_flag_for_followup) + (em_utils_flag_for_followup_completed): some cleanup/api stuff. + 2005-02-21 Not Zed ** See bug #64987 diff --git a/mail/em-utils.c b/mail/em-utils.c index 0236f2e329..f00e45ecf3 100644 --- a/mail/em-utils.c +++ b/mail/em-utils.c @@ -639,8 +639,14 @@ tag_editor_response (GtkWidget *dialog, int button, struct ted_t *ted) camel_folder_freeze (folder); for (i = 0; i < uids->len; i++) { - for (t = tags; t; t = t->next) - camel_folder_set_message_user_tag (folder, uids->pdata[i], t->name, t->value); + CamelMessageInfo *mi = camel_folder_get_message_info(folder, uids->pdata[i]); + + if (mi) { + for (t = tags; t; t = t->next) + camel_message_info_set_user_tag(mi, t->name, t->value); + + camel_message_info_free(mi); + } } camel_folder_thaw (folder); @@ -685,9 +691,12 @@ em_utils_flag_for_followup (GtkWidget *parent, CamelFolder *folder, GPtrArray *u CamelMessageInfo *info; info = camel_folder_get_message_info (folder, uids->pdata[i]); - message_tag_followup_append_message (MESSAGE_TAG_FOLLOWUP (editor), - camel_message_info_from (info), - camel_message_info_subject (info)); + if (info) { + message_tag_followup_append_message (MESSAGE_TAG_FOLLOWUP (editor), + camel_message_info_from (info), + camel_message_info_subject (info)); + camel_message_info_free(info); + } } /* special-case... */ @@ -699,8 +708,8 @@ em_utils_flag_for_followup (GtkWidget *parent, CamelFolder *folder, GPtrArray *u const CamelTag *tags = camel_message_info_user_tags(info); if (tags) - message_tag_editor_set_tag_list (MESSAGE_TAG_EDITOR (editor), tags); - camel_folder_free_message_info (folder, info); + message_tag_editor_set_tag_list (MESSAGE_TAG_EDITOR (editor), (CamelTag *)tags); + camel_message_info_free(info); } } @@ -729,9 +738,14 @@ em_utils_flag_for_followup_clear (GtkWidget *parent, CamelFolder *folder, GPtrAr camel_folder_freeze (folder); for (i = 0; i < uids->len; i++) { - camel_folder_set_message_user_tag (folder, uids->pdata[i], "follow-up", ""); - camel_folder_set_message_user_tag (folder, uids->pdata[i], "due-by", ""); - camel_folder_set_message_user_tag (folder, uids->pdata[i], "completed-on", ""); + CamelMessageInfo *mi = camel_folder_get_message_info(folder, uids->pdata[i]); + + if (mi) { + camel_message_info_set_user_tag(mi, "follow-up", NULL); + camel_message_info_set_user_tag(mi, "due-by", NULL); + camel_message_info_set_user_tag(mi, "completed-on", NULL); + camel_message_info_free(mi); + } } camel_folder_thaw (folder); @@ -762,12 +776,14 @@ em_utils_flag_for_followup_completed (GtkWidget *parent, CamelFolder *folder, GP camel_folder_freeze (folder); for (i = 0; i < uids->len; i++) { const char *tag; - - tag = camel_folder_get_message_user_tag (folder, uids->pdata[i], "follow-up"); - if (tag == NULL || *tag == '\0') - continue; - - camel_folder_set_message_user_tag (folder, uids->pdata[i], "completed-on", now); + CamelMessageInfo *mi = camel_folder_get_message_info(folder, uids->pdata[i]); + + if (mi) { + tag = camel_message_info_user_tag(mi, "follow-up"); + if (tag && tag[0]) + camel_message_info_set_user_tag(mi, "completed-on", now); + camel_message_info_free(mi); + } } camel_folder_thaw (folder); -- cgit v1.2.3