aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-ops.c
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2000-05-27 02:09:18 +0800
committerDan Winship <danw@src.gnome.org>2000-05-27 02:09:18 +0800
commit735c91373742948f85a0d7b0a69247d1cd4677de (patch)
tree6f60f1a24b2f7454da261be601250177ca1347b6 /mail/mail-ops.c
parentc6af86a140a9e54abdb19e4ccc127f061df65450 (diff)
downloadgsoc2013-evolution-735c91373742948f85a0d7b0a69247d1cd4677de.tar.gz
gsoc2013-evolution-735c91373742948f85a0d7b0a69247d1cd4677de.tar.zst
gsoc2013-evolution-735c91373742948f85a0d7b0a69247d1cd4677de.zip
set CAMEL_MESSAGE_ANSWERED on a message after a successful reply.
* mail-ops.c (composer_send_cb, reply): set CAMEL_MESSAGE_ANSWERED on a message after a successful reply. * message-list.c (folder_changed): free the summary with camel_folder_free_summary rather than g_ptr_array_free. svn path=/trunk/; revision=3221
Diffstat (limited to 'mail/mail-ops.c')
-rw-r--r--mail/mail-ops.c35
1 files changed, 27 insertions, 8 deletions
diff --git a/mail/mail-ops.c b/mail/mail-ops.c
index 16d045f1b0..606532a5ef 100644
--- a/mail/mail-ops.c
+++ b/mail/mail-ops.c
@@ -262,10 +262,16 @@ fetch_mail (GtkWidget *button, gpointer user_data)
}
+struct post_send_data {
+ CamelMimeMessage *message;
+ guint32 flags;
+};
+
static void
composer_send_cb (EMsgComposer *composer, gpointer data)
{
static CamelTransport *transport = NULL;
+ struct post_send_data *psd = data;
static char *from = NULL;
CamelException *ex;
CamelMimeMessage *message;
@@ -307,7 +313,7 @@ composer_send_cb (EMsgComposer *composer, gpointer data)
mail_exception_dialog ("Could not load mail transport",
ex, composer);
camel_exception_free (ex);
- return;
+ goto free_psd;
}
}
@@ -324,15 +330,23 @@ composer_send_cb (EMsgComposer *composer, gpointer data)
camel_transport_send (transport, CAMEL_MEDIUM (message), ex);
if (!camel_exception_is_set (ex))
camel_service_disconnect (CAMEL_SERVICE (transport), ex);
- if (camel_exception_is_set (ex)) {
+ if (camel_exception_is_set (ex))
mail_exception_dialog ("Could not send message", ex, composer);
- camel_exception_free (ex);
- gtk_object_unref (GTK_OBJECT (message));
- return;
+ else if (psd) {
+ guint32 set;
+
+ set = camel_mime_message_get_flags (psd->message);
+ camel_mime_message_set_flags (psd->message, psd->flags, ~set);
}
camel_exception_free (ex);
gtk_object_unref (GTK_OBJECT (message));
+
+ free_psd:
+ if (psd) {
+ gtk_object_unref (GTK_OBJECT (psd->message));
+ g_free (psd);
+ }
}
@@ -371,15 +385,20 @@ static void
reply (FolderBrowser *fb, gboolean to_all)
{
EMsgComposer *composer;
+ struct post_send_data *psd;
if (!check_configured ())
return;
- composer = mail_generate_reply (fb->mail_display->current_message,
- to_all);
+ psd = g_new (struct post_send_data, 1);
+ psd->message = fb->mail_display->current_message;
+ gtk_object_ref (GTK_OBJECT (psd->message));
+ psd->flags = CAMEL_MESSAGE_ANSWERED;
+
+ composer = mail_generate_reply (psd->message, to_all);
gtk_signal_connect (GTK_OBJECT (composer), "send",
- GTK_SIGNAL_FUNC (composer_send_cb), NULL);
+ GTK_SIGNAL_FUNC (composer_send_cb), psd);
gtk_widget_show (GTK_WIDGET (composer));
}