[evolution-exchange/gnome-3-4] Bug #677845 - Silently fails to send message



commit 3ad3617b8792a74cb99443324647ff3d5ea11976
Author: Milan Crha <mcrha redhat com>
Date:   Mon Jun 11 16:41:52 2012 +0200

    Bug #677845 - Silently fails to send message

 camel/camel-exchange-transport.c |    8 ++++++++
 camel/camel-exchange-utils.c     |    8 ++++++++
 2 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/camel/camel-exchange-transport.c b/camel/camel-exchange-transport.c
index 4dfe1de..fe46978 100644
--- a/camel/camel-exchange-transport.c
+++ b/camel/camel-exchange-transport.c
@@ -26,6 +26,7 @@
 #include <string.h>
 #include <glib/gi18n-lib.h>
 
+#include "camel-exchange-settings.h"
 #include "camel-exchange-transport.h"
 #include "camel-exchange-utils.h"
 
@@ -122,14 +123,21 @@ exchange_transport_send_to_sync (CamelTransport *transport,
 	if (store)
 		g_object_unref (CAMEL_OBJECT (store));
 
+	if (!success && error && !*error)
+		g_set_error_literal (error, CAMEL_ERROR, CAMEL_ERROR_GENERIC, _("Could not send message"));
+
 	return success;
 }
 
 static void
 camel_exchange_transport_class_init (CamelExchangeTransportClass *class)
 {
+	CamelServiceClass *service_class;
 	CamelTransportClass *transport_class;
 
+	service_class = CAMEL_SERVICE_CLASS (class);
+	service_class->settings_type = CAMEL_TYPE_EXCHANGE_SETTINGS;
+
 	transport_class = CAMEL_TRANSPORT_CLASS (class);
 	transport_class->send_to_sync = exchange_transport_send_to_sync;
 }
diff --git a/camel/camel-exchange-utils.c b/camel/camel-exchange-utils.c
index 4dac486..9089a0c 100644
--- a/camel/camel-exchange-utils.c
+++ b/camel/camel-exchange-utils.c
@@ -248,6 +248,14 @@ get_data_for_service (CamelService *service)
 
 	g_slist_free (accounts);
 
+	if (!res) {
+		g_warn_if_reached ();
+
+		/* there is configured only one account, thus use that ExchangeData */
+		if (edies && !edies->next)
+			res = edies->data;
+	}
+
 	G_UNLOCK (edies);
 
 	return res;



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