[evolution-patches] exchange plugins : fix for #314746



Hi,

This patch contains the changes for exchange plugin. Please review it.

Thanks
-- Sarfraaz
Index: exchange-account-setup.c
===================================================================
RCS file: /cvs/gnome/evolution/plugins/exchange-operations/exchange-account-setup.c,v
retrieving revision 1.18.2.2
diff -u -p -u -p -r1.18.2.2 exchange-account-setup.c
--- exchange-account-setup.c	15 Sep 2005 13:16:07 -0000	1.18.2.2
+++ exchange-account-setup.c	27 Sep 2005 13:04:52 -0000
@@ -464,6 +464,10 @@ owa_authenticate_user(GtkWidget *button,
 	   which should then be shown using e-error */
 
 	owa_url = camel_url_get_param (url, "owa_url");
+	if (camel_url_get_param (url, "authmech"))
+		exchange_params->is_ntlm = TRUE;
+	else
+		exchange_params->is_ntlm = FALSE;
 	valid =  e2k_validate_user (owa_url, url->user, exchange_params, 
 						&remember_password, &result);
 
Index: exchange-calendar.c
===================================================================
RCS file: /cvs/gnome/evolution/plugins/exchange-operations/exchange-calendar.c,v
retrieving revision 1.9
diff -u -p -u -p -r1.9 exchange-calendar.c
--- exchange-calendar.c	24 Aug 2005 09:43:41 -0000	1.9
+++ exchange-calendar.c	27 Sep 2005 13:04:52 -0000
@@ -83,7 +83,7 @@ e_exchange_calendar_get_calendars (ECalS
 	account = exchange_operations_get_exchange_account ();
 
 	/* FIXME: Reconsider this hardcoding */
-	uri_prefix = g_strconcat ("exchange://", account->account_filename, "/", NULL);
+	uri_prefix = g_strconcat ("exchange://", account->account_filename, "/;", NULL);
 	prefix_len = strlen (uri_prefix);
 
 	calendar_list = g_ptr_array_new ();
@@ -99,6 +99,7 @@ e_exchange_calendar_get_calendars (ECalS
 			tmp = (gchar *)e_folder_get_physical_uri (folder);
 			if (g_str_has_prefix (tmp, uri_prefix)) {
 				ruri = g_strdup (tmp+prefix_len); /* ATTN: Shouldn't free this explictly */
+				printf ("adding ruri : %s\n", ruri);
 				g_ptr_array_add (calendar_list, (gpointer)ruri);
 			}
 		}
@@ -124,7 +125,7 @@ e_exchange_calendar_pcalendar_on_change 
 	gtk_tree_selection_get_selected(selection, &model, &iter);
 
 	gtk_tree_model_get (model, &iter, CALENDARRURI_COL, &ruri, -1);
-	es_ruri = g_strconcat (account->account_filename, "/", ruri, NULL);
+	es_ruri = g_strconcat (account->account_filename, "/;", ruri, NULL);
 	e_source_set_relative_uri (source, es_ruri);
 	g_free (ruri);
 	g_free (es_ruri);
@@ -249,7 +250,7 @@ e_exchange_calendar_pcalendar (EPlugin *
 		int prefix_len;
 		GtkTreeSelection *selection;
 
-		uri_prefix = g_strconcat (account->account_filename, "/", NULL);
+		uri_prefix = g_strconcat (account->account_filename, "/;", NULL);
 		prefix_len = strlen (uri_prefix);
 		
 		tmpruri = (gchar*) rel_uri;
@@ -300,17 +301,23 @@ e_exchange_calendar_commit (EPlugin *epl
 	ESource *source = t->source;
 	gchar *uri_text, *gruri, *gname, *ruri, *ftype, *path, *path_prefix, *oldpath=NULL;
 	int prefix_len;
+	gint mode;
 	ExchangeAccount *account;
 	ExchangeAccountFolderResult result;
+	ExchangeConfigListenerStatus status;
 		
 	uri_text = e_source_get_uri (source);
 	if (uri_text && strncmp (uri_text, "exchange", 8)) {
 		g_free (uri_text);
 		return ;
 	}	
-	
+
+	status = exchange_is_offline (&mode); 	
+	if (mode == OFFLINE_MODE || status != CONFIG_LISTENER_STATUS_OK)
+		return;
+
 	account = exchange_operations_get_exchange_account ();
-	path_prefix = g_strconcat (account->account_filename, "/", NULL);
+	path_prefix = g_strconcat (account->account_filename, "/;", NULL);
 	prefix_len = strlen (path_prefix);
 	g_free (path_prefix);
 
Index: exchange-contacts.c
===================================================================
RCS file: /cvs/gnome/evolution/plugins/exchange-operations/exchange-contacts.c,v
retrieving revision 1.8
diff -u -p -u -p -r1.8 exchange-contacts.c
--- exchange-contacts.c	24 Aug 2005 09:43:41 -0000	1.8
+++ exchange-contacts.c	27 Sep 2005 13:04:53 -0000
@@ -70,7 +70,7 @@ e_exchange_contacts_get_contacts (void) 
 
 	account = exchange_operations_get_exchange_account ();
 
-	uri_prefix = g_strconcat ("exchange://", account->account_filename, "/", NULL);
+	uri_prefix = g_strconcat ("exchange://", account->account_filename, "/;", NULL);
 	prefix_len = strlen (uri_prefix);
 
 	contacts_list = g_ptr_array_new ();
@@ -110,7 +110,7 @@ e_exchange_contacts_pcontacts_on_change 
 	gchar *ruri;
 	
 	gtk_tree_model_get (model, &iter, CONTACTSRURI_COL, &ruri, -1);
-	es_ruri = g_strconcat (account->account_filename, "/", ruri, NULL);
+	es_ruri = g_strconcat (account->account_filename, "/;", ruri, NULL);
 	e_source_set_relative_uri (source, es_ruri);
 
 	g_free (ruri);
@@ -229,7 +229,7 @@ e_exchange_contacts_pcontacts (EPlugin *
 		GtkTreeSelection *selection;
 
 		tmpruri = (gchar*) rel_uri;
-		uri_prefix = g_strconcat (account->account_filename, "/", NULL);
+		uri_prefix = g_strconcat (account->account_filename, "/;", NULL);
 		prefix_len = strlen (uri_prefix);
 		
 		if (g_str_has_prefix (tmpruri, uri_prefix)) {
@@ -294,7 +294,7 @@ e_exchange_contacts_commit (EPlugin *epl
 	g_free (uri_text);
 
 	account = exchange_operations_get_exchange_account ();
-	path_prefix = g_strconcat (account->account_filename, "/", NULL);
+	path_prefix = g_strconcat (account->account_filename, "/;", NULL);
 	prefix_len = strlen (path_prefix);
 	g_free (path_prefix);
 
Index: exchange-folder.c
===================================================================
RCS file: /cvs/gnome/evolution/plugins/exchange-operations/exchange-folder.c,v
retrieving revision 1.12
diff -u -p -u -p -r1.12 exchange-folder.c
--- exchange-folder.c	26 Aug 2005 10:28:30 -0000	1.12
+++ exchange-folder.c	27 Sep 2005 13:04:53 -0000
@@ -87,7 +87,7 @@ org_gnome_exchange_folder_inbox_unsubscr
 		return;
 
 	target_uri = g_strdup (target->uri);
-	path = target->uri + strlen ("exchange://") + strlen (account->account_filename);
+	path = target->uri + strlen ("exchange://") + strlen (account->account_filename) + strlen ("/;");
 	/* User will be able to unsubscribe by doing a right click on
 	   any one of this two-<other user's>Inbox or the
 	   <other user's folder> tree. 
@@ -175,7 +175,7 @@ exchange_get_folder (char *uri, CamelFol
 		return;
 
 	/* Get the subscribed folder name. */
-	name = target_uri + strlen ("exchange://") + strlen (account->account_filename);
+	name = target_uri + strlen ("exchange://") + strlen (account->account_filename) + strlen ("/;");
 	stored_name = strrchr (name + 1, '/');
 
 	if (stored_name)
@@ -205,7 +205,7 @@ org_gnome_exchange_check_inbox_subscribe
 	if (!account)
 		return;
 
-	path = g_strdup_printf (target->uri + strlen ("exchange://") + strlen (account->account_filename));
+	path = g_strdup (target->uri + strlen ("exchange://") + strlen (account->account_filename) + strlen ("/;"));
 	sub_folder = strchr (path, '@');
 
 	g_free (path);
@@ -264,7 +264,7 @@ org_gnome_exchange_check_address_book_su
 		return;
 
 	uri = e_source_get_uri (source);
-	path = g_strdup_printf (uri + strlen ("exchange://") + strlen (account->account_filename));
+	path = g_strdup (uri + strlen ("exchange://") + strlen (account->account_filename) + strlen ("/;"));
 	sub_folder = strchr (path, '@');
 
 	if (!sub_folder) {
@@ -305,7 +305,7 @@ org_gnome_exchange_check_subscribed (EPl
 		return;
 
 	ruri = (gchar *) e_source_peek_relative_uri (source);
-	path = g_strdup_printf (ruri + strlen (account->account_filename));
+	path = g_strdup (ruri + strlen (account->account_filename) + strlen ("/;"));
 	sub_folder = strchr (path, '@');
 
 	if (!sub_folder) {
@@ -343,7 +343,7 @@ unsubscribe_dialog_ab_response (GtkDialo
 
 		source = e_source_selector_peek_primary_selection (E_SOURCE_SELECTOR (target->selector));
 		uri = e_source_get_uri (source);
-		path = g_strdup_printf (uri + strlen ("exchange://") + strlen (account->account_filename));
+		path = g_strdup (uri + strlen ("exchange://") + strlen (account->account_filename) + strlen ("/;"));
 		source_uid = e_source_peek_uid (source);
 
 		exchange_account_remove_shared_folder (account, path);
@@ -385,7 +385,7 @@ unsubscribe_dialog_response (GtkDialog *
 		ruri = (gchar *) e_source_peek_relative_uri (source);
 		source_uid = e_source_peek_uid (source);
 
-		path = g_strdup_printf (ruri + strlen (account->account_filename));
+		path = g_strdup (ruri + strlen (account->account_filename) + strlen ("/;"));
 		exchange_account_remove_shared_folder (account, path);
 		ids = gconf_client_get_list (client, 
 					     CONF_KEY_SELECTED_CAL_SOURCES, 


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