[evolution-mapi] Adapt to CamelSession and e-passwords changes.



commit 609380a1cad6c25455f25263e84c34874ce6a090
Author: Matthew Barnes <mbarnes redhat com>
Date:   Mon Jul 4 09:59:22 2011 -0400

    Adapt to CamelSession and e-passwords changes.

 .../exchange-mapi-account-listener.c               |   10 +++-------
 .../exchange-mapi-account-setup.c                  |   10 ++++------
 .../exchange-mapi-account-setup.h                  |    3 ---
 src/camel/camel-mapi-store.c                       |    5 +----
 4 files changed, 8 insertions(+), 20 deletions(-)
---
diff --git a/src/account-setup-eplugin/exchange-mapi-account-listener.c b/src/account-setup-eplugin/exchange-mapi-account-listener.c
index 65e8c34..1369a58 100644
--- a/src/account-setup-eplugin/exchange-mapi-account-listener.c
+++ b/src/account-setup-eplugin/exchange-mapi-account-listener.c
@@ -292,7 +292,6 @@ add_cal_esource (EAccount *account, GSList *folders, ExchangeMAPIFolderType fold
 			is_new_source = TRUE;
 		}
 		e_source_set_property (source, "auth", "1");
-		e_source_set_property (source, "auth-domain", EXCHANGE_MAPI_PASSWORD_COMPONENT);
 		e_source_set_property (source, "auth-type", "plain/password");
 		e_source_set_property (source, "username", url->user);
 		e_source_set_property (source, "host", url->host);
@@ -416,7 +415,6 @@ void exchange_mapi_add_esource (CamelURL *url, const gchar *folder_name, const g
 	relative_uri = g_strconcat (";", fid, NULL);
 	source = e_source_new (folder_name, relative_uri);
 	e_source_set_property (source, "auth", "1");
-	e_source_set_property (source, "auth-domain", EXCHANGE_MAPI_PASSWORD_COMPONENT);
 	e_source_set_property (source, "auth-type", "plain/password");
 	e_source_set_property (source, "username", url->user);
 	e_source_set_property (source, "host", url->host);
@@ -677,7 +675,6 @@ add_addressbook_sources (EAccount *account, GSList *folders, mapi_id_t trash_fid
 			is_new_source = TRUE;
 		}
 		e_source_set_property (source, "auth", "plain/password");
-		e_source_set_property (source, "auth-domain", EXCHANGE_MAPI_PASSWORD_COMPONENT);
 		e_source_set_property(source, "user", NULL);
 		e_source_set_property(source, "username", url->user);
 		e_source_set_property(source, "host", url->host);
@@ -739,7 +736,6 @@ add_addressbook_sources (EAccount *account, GSList *folders, mapi_id_t trash_fid
 		}
 		g_free (uri);
 		e_source_set_property (source, "auth", "plain/password");
-		e_source_set_property (source, "auth-domain", "MAPIGAL");
 
 		//FIXME: Offline handling
 		e_source_set_property(source, "user", NULL);
@@ -1086,7 +1082,7 @@ mapi_account_removed (EAccountList *account_listener, EAccount *account)
 		GError *error = NULL;
 
 		exchange_mapi_delete_profile (profile, &error);
-		e_passwords_forget_password (EXCHANGE_MAPI_PASSWORD_COMPONENT, key);
+		e_passwords_forget_password (NULL, key);
 
 		g_free (key);
 		camel_url_free (url);
@@ -1114,13 +1110,13 @@ create_profile_entry (CamelURL *url, EAccount *account)
 
 		key = camel_url_to_string (url, CAMEL_URL_HIDE_PASSWORD | CAMEL_URL_HIDE_PARAMS);
 		if (!attempts)
-			password = e_passwords_get_password (EXCHANGE_MAPI_PASSWORD_COMPONENT, key);
+			password = e_passwords_get_password (NULL, key);
 		if (!password) {
 			gboolean remember = account && e_account_get_bool (account, E_ACCOUNT_SOURCE_SAVE_PASSWD);
 			gchar *title;
 
 			title = g_strdup_printf (_("Enter Password for %s %s"), url->user, url->host);
-			password = e_passwords_ask_password (title, EXCHANGE_MAPI_PASSWORD_COMPONENT, key, title,
+			password = e_passwords_ask_password (title, NULL, key, title,
 					E_PASSWORDS_REMEMBER_FOREVER | E_PASSWORDS_SECRET | (attempts ? E_PASSWORDS_REPROMPT : 0),
 					&remember, NULL);
 			g_free (title);
diff --git a/src/account-setup-eplugin/exchange-mapi-account-setup.c b/src/account-setup-eplugin/exchange-mapi-account-setup.c
index 66bbc0f..5d1e030 100644
--- a/src/account-setup-eplugin/exchange-mapi-account-setup.c
+++ b/src/account-setup-eplugin/exchange-mapi-account-setup.c
@@ -242,14 +242,14 @@ validate_credentials (GtkWidget *widget, EConfig *config)
 	}
 
 	key = camel_url_to_string (url, CAMEL_URL_HIDE_PASSWORD | CAMEL_URL_HIDE_PARAMS);
-	password = e_passwords_get_password (EXCHANGE_MAPI_PASSWORD_COMPONENT, key);
+	password = e_passwords_get_password (NULL, key);
 	if (!password || !*password) {
 		gboolean remember = e_account_get_bool (target_account->modified_account, E_ACCOUNT_SOURCE_SAVE_PASSWD);
 		gchar *title;
 
 		g_free (password);
 		title = g_strdup_printf (_("Enter Password for %s %s"), url->user, url->host);
-		password = e_passwords_ask_password (title, EXCHANGE_MAPI_PASSWORD_COMPONENT, key, title,
+		password = e_passwords_ask_password (title, NULL, key, title,
 						     E_PASSWORDS_REMEMBER_FOREVER|E_PASSWORDS_SECRET,
 						     &remember, NULL);
 		g_free (title);
@@ -296,7 +296,7 @@ validate_credentials (GtkWidget *widget, EConfig *config)
 		} else {
 			gchar *e;
 
-			e_passwords_forget_password (EXCHANGE_MAPI_PASSWORD_COMPONENT, key);
+			e_passwords_forget_password (NULL, key);
 
 			e = g_strconcat (_("Authentication failed."), "\n", error ? error->message : NULL, NULL);
 
@@ -308,7 +308,7 @@ validate_credentials (GtkWidget *widget, EConfig *config)
 		if (error)
 			g_error_free (error);
 	} else {
-		e_passwords_forget_password (EXCHANGE_MAPI_PASSWORD_COMPONENT, key);
+		e_passwords_forget_password (NULL, key);
 		e_notice (NULL, GTK_MESSAGE_ERROR, "%s", _("Authentication failed."));
 	}
 
@@ -810,7 +810,6 @@ exchange_mapi_book_commit (EPlugin *epl, EConfigTarget *target)
 	//FIXME: Offline handling
 	grp = e_source_peek_group (source);
 	e_source_set_property (source, "auth", "plain/password");
-	e_source_set_property (source, "auth-domain", EXCHANGE_MAPI_PASSWORD_COMPONENT);
 	e_source_set_property(source, "user", NULL);
 	e_source_set_property(source, "username", e_source_group_get_property (grp, "username") ? e_source_group_get_property (grp, "username") : e_source_group_get_property (grp, "user"));
 	e_source_set_property(source, "host", e_source_group_get_property (grp, "host"));
@@ -920,7 +919,6 @@ exchange_mapi_cal_commit (EPlugin *epl, EConfigTarget *target)
 	g_free (sfid);
 
 	e_source_set_property (source, "auth", "1");
-	e_source_set_property (source, "auth-domain", EXCHANGE_MAPI_PASSWORD_COMPONENT);
 	e_source_set_property (source, "auth-type", "plain/password");
 	e_source_set_property (source, "public", "no");
 
diff --git a/src/account-setup-eplugin/exchange-mapi-account-setup.h b/src/account-setup-eplugin/exchange-mapi-account-setup.h
index 9d5eb34..d5d5f96 100644
--- a/src/account-setup-eplugin/exchange-mapi-account-setup.h
+++ b/src/account-setup-eplugin/exchange-mapi-account-setup.h
@@ -26,9 +26,6 @@
 
 #include "exchange-mapi-account-listener.h"
 
-/* This definition should be in-sync with the definition in camel-mapi-store.c */
-#define EXCHANGE_MAPI_PASSWORD_COMPONENT "ExchangeMAPI"
-
 #define MAPI_URI_PREFIX   "mapi://" 
 #define MAPI_PREFIX_LENGTH 7
 
diff --git a/src/camel/camel-mapi-store.c b/src/camel/camel-mapi-store.c
index 0e45a85..f0d4f16 100644
--- a/src/camel/camel-mapi-store.c
+++ b/src/camel/camel-mapi-store.c
@@ -42,9 +42,6 @@
 #include <exchange-mapi-utils.h>
 //#define d(x) x
 
-/* This definition should be in-sync with those in exchange-mapi-account-setup.c and exchange-account-listener.c */
-#define E_PASSWORD_COMPONENT "ExchangeMAPI"
-
 #include <sys/types.h>
 #include <stdint.h>
 #include <stdbool.h>
@@ -1674,7 +1671,7 @@ mapi_auth_loop (CamelService *service, GError **error)
 						  url->user,
 						  url->host);
 			url->passwd =
-				camel_session_get_password (session, service, E_PASSWORD_COMPONENT,
+				camel_session_get_password (session, service,
 							    prompt, "password", prompt_flags, NULL);
 			g_free (prompt);
 			g_free (errbuf);



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