aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-callbacks.c
diff options
context:
space:
mode:
authorNot Zed <NotZed@HelixCode.com>2001-01-04 15:34:26 +0800
committerMichael Zucci <zucchi@src.gnome.org>2001-01-04 15:34:26 +0800
commitf4f3ede9d32822a9398992e1e80bfb18a3eae635 (patch)
tree0a88345db8abe8811318f9b110a31dfb5d0aeb7c /mail/mail-callbacks.c
parentbf08ae0bb273c9add8bf97e36a5f195900b9f176 (diff)
downloadgsoc2013-evolution-f4f3ede9d32822a9398992e1e80bfb18a3eae635.tar
gsoc2013-evolution-f4f3ede9d32822a9398992e1e80bfb18a3eae635.tar.gz
gsoc2013-evolution-f4f3ede9d32822a9398992e1e80bfb18a3eae635.tar.bz2
gsoc2013-evolution-f4f3ede9d32822a9398992e1e80bfb18a3eae635.tar.lz
gsoc2013-evolution-f4f3ede9d32822a9398992e1e80bfb18a3eae635.tar.xz
gsoc2013-evolution-f4f3ede9d32822a9398992e1e80bfb18a3eae635.tar.zst
gsoc2013-evolution-f4f3ede9d32822a9398992e1e80bfb18a3eae635.zip
Removed old implementation.
2001-01-04 Not Zed <NotZed@HelixCode.com> * mail-ops.c (mail_do_send_mail): Removed old implementation. * folder-browser.c (do_message_selected): If we haven't got a real uid, then clear the display instead. * message-list.c (message_list_drag_data_get): Use new save message function, and also wait for it to finish before continuing. (folder_changed): (message_changed): Use mail_proxy_event instead of mail_do_forward. (mail_regen_list): New iplementation to replace the old. : remove <gnome.h> from headers. Dont define timeit by default. (main_folder_changed): (message_list_set_folder): (message_list_set_threaded): (message_list_set_search): (message_list_hide_add): (message_list_hide_uids): (message_list_hide_clear): Use mail_regen_list instead of mail_do_regenerate_messagelist. (mail_do_regenerate_messagelist): Removed the old stuff. No functionality changed yet, just using different thread stuff. * mail-callbacks.c (save_msg_ok): Use new save message function. * component-factory.c (create_view): (add_storage): Use mail_scan_subfolders to build the folder info. (create_folder): Use new implementation with our own callback. (owner_set_cb): Changed b ack to use mail_get_folder, but now wait for it to finish. This will let any gui still run, but also gives us the required synchronous operation. (got_folder): Callback for when the folder has been opened. * mail-ops.c (mail_get_folderinfo): New function to just get the folder info in another thread. (mail_scan_subfolders): New scan subfolder implementation that uses mail_get_folderinfo. (mail_do_scan_subfolders): Removed old implementation. (mail_create_folder): Nerw implementation to create a folder, only. (mail_do_create_folder): Removed old implementation. (mail_save_messages): New implementation, fixes a couple of minor problems, and now provides a return so it can be waited on. Also check that the writes worked, etc. (mail_do_save_messages): Remove previous implementation. (mail_do_flag_messages): Removed, nothing uses it. (mail_do_flag_messages): Removed, nothing uses it anymore. (mail_get_folder): REturn the operation id, so callers can wait for it. (sync_folder_desc): (expunge_folder_desc): Add describe functions so we know what its doing. (mail_send_mail): More generic implementation of sending mail. * mail-mt.c (mail_msg_new): Lock around seq increment. And insert each new message into a hash table of active messages. (mail_msg_init): Init the active message table. (mail_msg_free): Remove the message from the active message table. (mail_msg_wait): New function, waits for a message to be processed, by id. (mail_msg_check_error): Dont display the error if it is a user-cancelled operation. (mail_proxy_event): new implementation of mail_op_forward_event. Only real difference is it uses the new thread stuff, and you can wait for it to finish if you want. (mail_proxy_event): If we're already in the main thread, just call the function. svn path=/trunk/; revision=7246
Diffstat (limited to 'mail/mail-callbacks.c')
-rw-r--r--mail/mail-callbacks.c43
1 files changed, 32 insertions, 11 deletions
diff --git a/mail/mail-callbacks.c b/mail/mail-callbacks.c
index a565da9f97..9c7cd1e2b8 100644
--- a/mail/mail-callbacks.c
+++ b/mail/mail-callbacks.c
@@ -266,6 +266,28 @@ free_psd (GtkWidget *composer, gpointer user_data)
g_free (psd);
}
+struct _send_data {
+ EMsgComposer *composer;
+ struct post_send_data *psd;
+};
+
+static void
+composer_sent_cb(char *uri, CamelMimeMessage *message, gboolean sent, void *data)
+{
+ struct _send_data *send = data;
+
+ if (sent) {
+ if (send->psd) {
+ camel_folder_set_message_flags(send->psd->folder, send->psd->uid, send->psd->flags, send->psd->flags);
+ }
+ gtk_widget_destroy((GtkWidget *)send->composer);
+ } else {
+ gtk_widget_show((GtkWidget *)send->composer);
+ gtk_object_unref((GtkObject *)send->composer);
+ }
+ g_free(send);
+}
+
void
composer_send_cb (EMsgComposer *composer, gpointer data)
{
@@ -274,7 +296,8 @@ composer_send_cb (EMsgComposer *composer, gpointer data)
const CamelInternetAddress *iaddr;
const char *subject;
struct post_send_data *psd = data;
-
+ struct _send_data *send;
+
/* Config info */
xport = mail_config_get_transport ();
@@ -305,15 +328,13 @@ composer_send_cb (EMsgComposer *composer, gpointer data)
return;
}
}
-
- if (psd) {
- mail_do_send_mail (xport->url, message,
- psd->folder, psd->uid, psd->flags,
- GTK_WIDGET (composer));
- } else {
- mail_do_send_mail (xport->url, message, NULL, NULL, 0,
- GTK_WIDGET (composer));
- }
+
+ send = g_malloc(sizeof(*send));
+ send->psd = psd;
+ send->composer = composer;
+ gtk_object_ref((GtkObject *)composer);
+ gtk_widget_hide((GtkWidget *)composer);
+ mail_send_mail(xport->url, message, composer_sent_cb, send);
}
void
@@ -773,7 +794,7 @@ save_msg_ok (GtkWidget *widget, gpointer user_data)
folder = gtk_object_get_data (GTK_OBJECT (user_data), "folder");
uids = gtk_object_get_data (GTK_OBJECT (user_data), "uids");
gtk_object_remove_no_notify (GTK_OBJECT (user_data), "uids");
- mail_do_save_messages (folder, uids, path);
+ mail_save_messages (folder, uids, path, NULL, NULL);
}
gtk_widget_destroy (GTK_WIDGET (user_data));