[evolution-patches] 61824, mail, reply to selection doesn't update flags
- From: Not Zed <notzed ximian com>
- To: evolution-patches lists ximian com
- Subject: [evolution-patches] 61824, mail, reply to selection doesn't update flags
- Date: Fri, 23 Jul 2004 08:59:46 +0000
its a pity we cant do something for the embedded message parts. maybe something for the future.
Index: mail/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/mail/ChangeLog,v
retrieving revision 1.3418
diff -u -3 -r1.3418 ChangeLog
--- mail/ChangeLog 23 Jul 2004 03:49:22 -0000 1.3418
+++ mail/ChangeLog 23 Jul 2004 08:52:46 -0000
@@ -1,3 +1,23 @@
+2004-07-23 Not Zed <NotZed Ximian com>
+
+ ** See bug #61824.
+
+ * em-popup.c (emp_part_popup_reply_sender)
+ (emp_part_popup_reply_list, emp_part_popup_reply_all): use new
+ api. We have no uid/folder to update here.
+
+ * em-folder-view.c (emfv_message_reply): use new api for replying
+ so we can supply the message content and have flags updated.
+
+ * em-composer-utils.c (em_utils_reply_to_message): added optional
+ folder and uid.
+ (em_utils_reply_to_message_by_uid): removed, use the other
+ interface instead.
+ (reply_to_message): just call reply_to_message if we get a message
+ to reply to.
+ (em_utils_reply_to_message): if no message supplied, load it via
+ the uid.
+
2004-07-22 Not Zed <NotZed Ximian com>
* em-utils.c (em_utils_part_to_html, em_utils_message_to_html):
Index: mail/em-composer-utils.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/em-composer-utils.c,v
retrieving revision 1.17
diff -u -3 -r1.17 em-composer-utils.c
--- mail/em-composer-utils.c 15 Jun 2004 20:27:55 -0000 1.17
+++ mail/em-composer-utils.c 23 Jul 2004 08:52:47 -0000
@@ -1690,72 +1690,54 @@
e_msg_composer_drop_editor_undo (composer);
}
+static void
+reply_to_message(CamelFolder *folder, const char *uid, CamelMimeMessage *message, void *user_data)
+{
+ if (message != NULL)
+ em_utils_reply_to_message(folder, uid, message, GPOINTER_TO_INT(user_data));
+}
+
/**
* em_utils_reply_to_message:
- * @message: message to reply to
+ * @folder: optional folder
+ * @uid: optional uid
+ * @message: message to reply to, optional
* @mode: reply mode
*
* Creates a new composer ready to reply to @message.
+ *
+ * If @message is NULL then @folder and @uid must be set to the
+ * message to be replied to, it will be loaded asynchronously.
+ *
+ * If @message is non null, then it is used directly, @folder and @uid
+ * may be supplied in order to update the message flags once it has
+ * been replied to.
**/
void
-em_utils_reply_to_message (CamelMimeMessage *message, int mode)
+em_utils_reply_to_message(CamelFolder *folder, const char *uid, CamelMimeMessage *message, int mode)
{
CamelInternetAddress *to = NULL, *cc = NULL;
EMsgComposer *composer;
EAccount *account;
-
- account = guess_account (message, NULL);
-
- switch (mode) {
- case REPLY_MODE_SENDER:
- get_reply_sender (message, &to, NULL);
- break;
- case REPLY_MODE_LIST:
- if (get_reply_list (message, &to))
- break;
- case REPLY_MODE_ALL:
- get_reply_all (message, &to, &cc, NULL);
- break;
- }
-
- composer = reply_get_composer (message, account, to, cc, NULL, NULL);
- e_msg_composer_add_message_attachments (composer, message, TRUE);
-
- if (to != NULL)
- camel_object_unref (to);
-
- if (cc != NULL)
- camel_object_unref (cc);
-
- composer_set_body (composer, message);
-
- em_composer_utils_setup_default_callbacks (composer);
-
- gtk_widget_show (GTK_WIDGET (composer));
- e_msg_composer_unset_changed (composer);
-}
-
-static void
-reply_to_message (CamelFolder *folder, const char *uid, CamelMimeMessage *message, void *user_data)
-{
- CamelInternetAddress *to = NULL, *cc = NULL;
const char *postto = NULL;
- EMsgComposer *composer;
- EAccount *account;
guint32 flags;
- int mode;
-
- if (message == NULL)
+
+ if (folder && uid && message == NULL) {
+ mail_get_message(folder, uid, reply_to_message, GINT_TO_POINTER(mode), mail_thread_new);
return;
-
- mode = GPOINTER_TO_INT (user_data);
+ }
- account = guess_account (message, folder);
+ g_return_if_fail(message != NULL);
+
+ account = guess_account (message, NULL);
flags = CAMEL_MESSAGE_ANSWERED | CAMEL_MESSAGE_SEEN;
switch (mode) {
case REPLY_MODE_SENDER:
- get_reply_sender (message, &to, &postto);
+ if (folder)
+ get_reply_sender (message, &to, &postto);
+ else
+ get_reply_sender (message, &to, NULL);
break;
case REPLY_MODE_LIST:
flags |= CAMEL_MESSAGE_ANSWERED_ALL;
@@ -1763,7 +1745,10 @@
break;
case REPLY_MODE_ALL:
flags |= CAMEL_MESSAGE_ANSWERED_ALL;
- get_reply_all (message, &to, &cc, &postto);
+ if (folder)
+ get_reply_all (message, &to, &cc, &postto);
+ else
+ get_reply_all (message, &to, &cc, NULL);
break;
}
@@ -1782,24 +1767,6 @@
gtk_widget_show (GTK_WIDGET (composer));
e_msg_composer_unset_changed (composer);
-}
-
-/**
- * em_utils_reply_to_message_by_uid:
- * @folder: folder containing message to reply to
- * @uid: message uid
- * @mode: reply mode
- *
- * Creates a new composer ready to reply to the message referenced by
- * @folder and @uid.
- **/
-void
-em_utils_reply_to_message_by_uid (CamelFolder *folder, const char *uid, int mode)
-{
- g_return_if_fail (CAMEL_IS_FOLDER (folder));
- g_return_if_fail (uid != NULL);
-
- mail_get_message (folder, uid, reply_to_message, GINT_TO_POINTER (mode), mail_thread_new);
}
/* Posting replies... */
Index: mail/em-composer-utils.h
===================================================================
RCS file: /cvs/gnome/evolution/mail/em-composer-utils.h,v
retrieving revision 1.5
diff -u -3 -r1.5 em-composer-utils.h
--- mail/em-composer-utils.h 14 May 2004 18:07:30 -0000 1.5
+++ mail/em-composer-utils.h 23 Jul 2004 08:52:47 -0000
@@ -68,8 +68,7 @@
REPLY_MODE_LIST
};
-void em_utils_reply_to_message (struct _CamelMimeMessage *message, int mode);
-void em_utils_reply_to_message_by_uid (struct _CamelFolder *folder, const char *uid, int mode);
+void em_utils_reply_to_message (struct _CamelFolder *, const char *uid, struct _CamelMimeMessage *message, int mode);
void em_utils_post_reply_to_message_by_uid (struct _CamelFolder *folder, const char *uid);
Index: mail/em-folder-view.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/em-folder-view.c,v
retrieving revision 1.82
diff -u -3 -r1.82 em-folder-view.c
--- mail/em-folder-view.c 23 Jul 2004 03:49:22 -0000 1.82
+++ mail/em-folder-view.c 23 Jul 2004 08:52:47 -0000
@@ -1266,15 +1266,15 @@
((GString *)state->user_data)->str,
((GString *)state->user_data)->len,
"text/html");
- em_utils_reply_to_message (msg, mode);
+ em_utils_reply_to_message (emfv->folder, emfv->list->cursor_uid, msg, mode);
camel_object_unref(msg);
} else {
- em_utils_reply_to_message_by_uid (emfv->folder, emfv->list->cursor_uid, mode);
+ em_utils_reply_to_message (emfv->folder, emfv->list->cursor_uid, NULL, mode);
}
html_engine_save_buffer_free(state);
} else {
- em_utils_reply_to_message_by_uid (emfv->folder, emfv->list->cursor_uid, mode);
+ em_utils_reply_to_message(emfv->folder, emfv->list->cursor_uid, NULL, mode);
}
}
Index: mail/em-popup.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/em-popup.c,v
retrieving revision 1.24
diff -u -3 -r1.24 em-popup.c
--- mail/em-popup.c 22 Jun 2004 19:39:20 -0000 1.24
+++ mail/em-popup.c 23 Jul 2004 08:52:48 -0000
@@ -772,7 +772,7 @@
CamelMimeMessage *message;
message = (CamelMimeMessage *) camel_medium_get_content_object ((CamelMedium *) t->data.part.part);
- em_utils_reply_to_message (message, REPLY_MODE_SENDER);
+ em_utils_reply_to_message (NULL, NULL, message, REPLY_MODE_SENDER);
}
static void
@@ -781,7 +781,7 @@
CamelMimeMessage *message;
message = (CamelMimeMessage *) camel_medium_get_content_object ((CamelMedium *) t->data.part.part);
- em_utils_reply_to_message (message, REPLY_MODE_LIST);
+ em_utils_reply_to_message (NULL, NULL, message, REPLY_MODE_LIST);
}
static void
@@ -790,7 +790,7 @@
CamelMimeMessage *message;
message = (CamelMimeMessage *) camel_medium_get_content_object ((CamelMedium *) t->data.part.part);
- em_utils_reply_to_message (message, REPLY_MODE_ALL);
+ em_utils_reply_to_message (NULL, NULL, message, REPLY_MODE_ALL);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]