[evolution-data-server/email-factory] Fix a couple of crashers.



commit 1461b301fb44ca0793e42f771671cb519a1a3945
Author: Srinivasa Ragavan <sragavan gnome org>
Date:   Thu Apr 28 00:33:07 2011 +0530

    Fix a couple of crashers.

 mail/daemon/e-mail-data-folder.c |    8 ++++++++
 mail/daemon/mail-ops.c           |    3 ++-
 mail/daemon/mail-session.c       |    5 ++++-
 3 files changed, 14 insertions(+), 2 deletions(-)
---
diff --git a/mail/daemon/e-mail-data-folder.c b/mail/daemon/e-mail-data-folder.c
index 1996d72..fef8493 100644
--- a/mail/daemon/e-mail-data-folder.c
+++ b/mail/daemon/e-mail-data-folder.c
@@ -1,6 +1,7 @@
 /* e-mail-data-folder.c */
 
 #include <glib/gi18n.h>
+#include "e-mail-local.h"
 #include "e-mail-data-folder.h"
 #include "e-mail-data-session.h"
 #include "e-gdbus-emailfolder.h"
@@ -934,6 +935,7 @@ app_msg_done (gboolean success, gpointer sdata, GError *error)
 {
 	EMailFolderMessageData *data = (EMailFolderMessageData *)sdata;
 	EMailDataFolderPrivate *priv = DATA_FOLDER_PRIVATE(data->mfolder);
+	CamelFolder *outbox;
 
 	if (error && error->message) {
 		g_warning ("Append message failed: %s: %s\n", priv->path, error->message);
@@ -946,6 +948,12 @@ app_msg_done (gboolean success, gpointer sdata, GError *error)
 	
 	ipc(printf("Apppend message: %s success: %s\n", priv->path, data->uid));
 
+	outbox = e_mail_local_get_folder (E_MAIL_FOLDER_OUTBOX);
+	if (priv->folder == outbox) {
+		/* We just appended to OUTBOX. Issue a Send command */
+		mail_send();
+	}
+
 	g_object_unref (data->message);
 	camel_message_info_free (data->info);
 	g_free (data->uid);
diff --git a/mail/daemon/mail-ops.c b/mail/daemon/mail-ops.c
index 3b2cac3..b473c19 100644
--- a/mail/daemon/mail-ops.c
+++ b/mail/daemon/mail-ops.c
@@ -918,7 +918,8 @@ mail_send_queue(CamelFolder *queue, const gchar *destination,
 	m->data = data;
 
 	m->driver = camel_session_get_filter_driver (session, type, NULL);
-	camel_filter_driver_set_folder_func (m->driver, get_folder, get_data);
+	if (m->driver)
+		camel_filter_driver_set_folder_func (m->driver, get_folder, get_data);
 
 	mail_msg_unordered_push (m);
 }
diff --git a/mail/daemon/mail-session.c b/mail/daemon/mail-session.c
index bdacd06..853578d 100644
--- a/mail/daemon/mail-session.c
+++ b/mail/daemon/mail-session.c
@@ -200,7 +200,6 @@ get_password (CamelSession *session,
 		int count=0;
 
 		timer = e_flag_new ();
-		tval.tv_sec = 60; /* Reprompt every 60sec*/
 
 		if (domain == NULL)
 			domain = "Mail";
@@ -243,6 +242,10 @@ repeat:
 				count++;
 				if (count <= 2) {
 					/* FIXME: This is an ugly hack for now. Ideally we should return and let the backends requery when NEED_PASSWORD error is returned. */
+					
+					g_get_current_time (&tval);
+					g_time_val_add (&tval, 60*1000*1000);
+					g_debug ("Waiting 60secs for password: %s\n", key);
 					e_flag_timed_wait (timer, &tval);
 					goto repeat;
 				}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]