[evolution-exchange] Adapt to Evolution API changes.



commit 5aab0bef283d874505b2096dca2ac441ad69043d
Author: Matthew Barnes <mbarnes redhat com>
Date:   Mon Oct 11 13:29:11 2010 -0400

    Adapt to Evolution API changes.

 eplugin/exchange-delegates-user.c    |   12 +++++++++++-
 eplugin/exchange-folder.c            |   13 ++++++++++++-
 eplugin/exchange-mail-send-options.c |   16 ++++++++--------
 3 files changed, 31 insertions(+), 10 deletions(-)
---
diff --git a/eplugin/exchange-delegates-user.c b/eplugin/exchange-delegates-user.c
index b7bd34d..3a7ac71 100644
--- a/eplugin/exchange-delegates-user.c
+++ b/eplugin/exchange-delegates-user.c
@@ -28,6 +28,7 @@
 #include "exchange-delegates.h"
 #include "exchange-delegates-user.h"
 
+#include <shell/e-shell.h>
 #include <mail/mail-ops.h>
 #include <mail/mail-send-recv.h>
 #include <mail/e-mail-local.h>
@@ -176,8 +177,17 @@ static void
 em_utils_delegates_done (CamelFolder *folder, CamelMimeMessage *msg, CamelMessageInfo *info,
 		       gint queued, const gchar *appended_uid, gpointer data)
 {
+	EShell *shell;
+	EShellBackend *shell_backend;
+	EMailSession *session;
+
+	/* XXX Dig up the EMailSession from the default EShell. */
+	shell = e_shell_get_default ();
+	shell_backend = e_shell_get_backend_by_name (shell, "mail");
+	session = e_mail_backend_get_session (E_MAIL_BACKEND (shell_backend));
+
 	camel_message_info_free (info);
-	mail_send ();
+	mail_send (session);
 }
 
 /**
diff --git a/eplugin/exchange-folder.c b/eplugin/exchange-folder.c
index 1b83345..5d6a15b 100644
--- a/eplugin/exchange-folder.c
+++ b/eplugin/exchange-folder.c
@@ -31,6 +31,7 @@
 #include <exchange-hierarchy.h>
 #include <libedataserverui/e-source-selector.h>
 #include <e-util/e-alert-dialog.h>
+#include <mail/e-mail-backend.h>
 #include <mail/mail-mt.h>
 #include <mail/mail-ops.h>
 #include <shell/e-shell.h>
@@ -105,6 +106,9 @@ exchange_get_folder (gchar *uri, CamelFolder *folder, gpointer data)
 static void
 eex_folder_inbox_unsubscribe (const gchar *uri)
 {
+	EShell *shell;
+	EShellBackend *shell_backend;
+	EMailSession *session;
 	ExchangeAccount *account = NULL;
 	gchar *path = NULL;
 	gchar *stored_path = NULL;
@@ -179,8 +183,15 @@ eex_folder_inbox_unsubscribe (const gchar *uri)
 	inbox = exchange_account_get_folder (account, inbox_uri);
 	inbox_physical_uri = e_folder_get_physical_uri (inbox);
 
+	/* XXX Dig up the EMailSession from the default EShell. */
+	shell = e_shell_get_default ();
+	shell_backend = e_shell_get_backend_by_name (shell, "mail");
+	session = e_mail_backend_get_session (E_MAIL_BACKEND (shell_backend));
+
 	/* To get the CamelStore/Folder */
-	mail_get_folder (inbox_physical_uri, 0, exchange_get_folder, target_uri, mail_msg_unordered_push);
+	mail_get_folder (
+		session, inbox_physical_uri, 0,
+		exchange_get_folder, target_uri, mail_msg_unordered_push);
 }
 
 static void
diff --git a/eplugin/exchange-mail-send-options.c b/eplugin/exchange-mail-send-options.c
index 3d7729b..745d1e7 100644
--- a/eplugin/exchange-mail-send-options.c
+++ b/eplugin/exchange-mail-send-options.c
@@ -52,10 +52,10 @@ append_to_header (ExchangeSendOptionsDialog *dialog, gint state, gpointer data)
 		if (dialog->options->importance) {
 			switch (dialog->options->importance) {
 				case E_IMP_HIGH :
-					e_msg_composer_modify_header (composer, "Importance", "high");
+					e_msg_composer_set_header (composer, "Importance", "high");
 					break;
 				case E_IMP_LOW :
-					e_msg_composer_modify_header (composer, "Importance", "low");
+					e_msg_composer_set_header (composer, "Importance", "low");
 					break;
 				default :
 					g_print ("\nNo importance set");
@@ -68,13 +68,13 @@ append_to_header (ExchangeSendOptionsDialog *dialog, gint state, gpointer data)
 		if (dialog->options->sensitivity) {
 			switch (dialog->options->sensitivity) {
 				case E_SENSITIVITY_CONFIDENTIAL :
-					e_msg_composer_modify_header (composer, "Sensitivity", "Company-Confidential");
+					e_msg_composer_set_header (composer, "Sensitivity", "Company-Confidential");
 					break;
 				case E_SENSITIVITY_PERSONAL :
-					e_msg_composer_modify_header (composer, "Sensitivity", "Personal");
+					e_msg_composer_set_header (composer, "Sensitivity", "Personal");
 					break;
 				case E_SENSITIVITY_PRIVATE :
-					e_msg_composer_modify_header (composer, "Sensitivity", "Private");
+					e_msg_composer_set_header (composer, "Sensitivity", "Private");
 					break;
 				default :
 					g_print ("\nNo importance set");
@@ -94,7 +94,7 @@ append_to_header (ExchangeSendOptionsDialog *dialog, gint state, gpointer data)
 			dialog->options->delegate_address &&
 				g_ascii_strcasecmp (addr->v.addr, sender_addr->v.addr)) {
 
-			e_msg_composer_modify_header (composer, "Sender" , sender_id);
+			e_msg_composer_set_header (composer, "Sender" , sender_id);
 
 			/* This block handles the case wherein the address to be added
 			 * in the "From" field has no name associated with it.
@@ -127,7 +127,7 @@ append_to_header (ExchangeSendOptionsDialog *dialog, gint state, gpointer data)
 			mdn_address = account->id->reply_to;
 			if (!mdn_address || !*mdn_address)
 				mdn_address = account->id->address;
-			e_msg_composer_modify_header (composer, "Return-Receipt-To", mdn_address);
+			e_msg_composer_set_header (composer, "Return-Receipt-To", mdn_address);
 		}
 		else
 			e_msg_composer_remove_header (composer, "Return-Receipt-To");
@@ -143,7 +143,7 @@ append_to_header (ExchangeSendOptionsDialog *dialog, gint state, gpointer data)
 			if (!mdn_address || !*mdn_address)
 				mdn_address = account->id->address;
 
-			e_msg_composer_modify_header (composer, "Disposition-Notification-To", mdn_address);
+			e_msg_composer_set_header (composer, "Disposition-Notification-To", mdn_address);
 		}
 		else
 			e_msg_composer_remove_header (composer, "Disposition-Notification-To");



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