From 514e598c0a19acb718a68c20e89585a9bc7e7566 Mon Sep 17 00:00:00 2001 From: Harry Lu Date: Wed, 27 Jul 2005 09:12:38 +0000 Subject: Only show the unsubscribe menu if it is an exchange folder. 2005-07-27 Harry Lu Only show the unsubscribe menu if it is an exchange folder. * exchange-folder.c: (org_gnome_exchange_check_address_book_subscribed), (org_gnome_exchange_check_subscribed): svn path=/trunk/; revision=29898 --- plugins/exchange-operations/ChangeLog | 7 +++++++ plugins/exchange-operations/exchange-folder.c | 18 ++++++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) (limited to 'plugins/exchange-operations') diff --git a/plugins/exchange-operations/ChangeLog b/plugins/exchange-operations/ChangeLog index a35b2703d0..017ea5aa20 100644 --- a/plugins/exchange-operations/ChangeLog +++ b/plugins/exchange-operations/ChangeLog @@ -1,3 +1,10 @@ +2005-07-27 Harry Lu + + Only show the unsubscribe menu if it is an exchange folder. + * exchange-folder.c: + (org_gnome_exchange_check_address_book_subscribed), + (org_gnome_exchange_check_subscribed): + 2005-07-25 Shakti Sen * org-gnome-exchange-operations.eplug.in: Fixed a small typo. diff --git a/plugins/exchange-operations/exchange-folder.c b/plugins/exchange-operations/exchange-folder.c index 4c20c54136..139ead0fa8 100644 --- a/plugins/exchange-operations/exchange-folder.c +++ b/plugins/exchange-operations/exchange-folder.c @@ -124,6 +124,7 @@ org_gnome_exchange_check_address_book_subscribed (EPlugin *ep, EABPopupTargetSou gchar *path = NULL; char *sub_folder = NULL; ExchangeAccount *account = NULL; + ESourceGroup *group; account = exchange_operations_get_exchange_account (); @@ -131,12 +132,18 @@ org_gnome_exchange_check_address_book_subscribed (EPlugin *ep, EABPopupTargetSou return; source = e_source_selector_peek_primary_selection (E_SOURCE_SELECTOR (target->selector)); + group = e_source_peek_group (source); + if (!group || strcmp (e_source_group_peek_base_uri (group), "exchange://")) + return; + uri = e_source_get_uri (source); path = g_strdup_printf (uri + strlen ("exchange://") + strlen (account->account_filename)); sub_folder = strchr (path, '@'); - if (!sub_folder) + if (!sub_folder) { + g_free (path); return; + } for (i = 0; i < sizeof (popup_ab_items) / sizeof (popup_ab_items[0]); i++) menus = g_slist_prepend (menus, &popup_ab_items[i]); @@ -156,6 +163,7 @@ org_gnome_exchange_check_subscribed (EPlugin *ep, ECalPopupTargetSource *target) gchar *path = NULL; char *sub_folder = NULL; ExchangeAccount *account = NULL; + ESourceGroup *group; account = exchange_operations_get_exchange_account (); @@ -163,12 +171,18 @@ org_gnome_exchange_check_subscribed (EPlugin *ep, ECalPopupTargetSource *target) return; source = e_source_selector_peek_primary_selection (E_SOURCE_SELECTOR (target->selector)); + group = e_source_peek_group (source); + if (!group || strcmp (e_source_group_peek_base_uri (group), "exchange://")) + return; + ruri = (gchar *) e_source_peek_relative_uri (source); path = g_strdup_printf (ruri + strlen (account->account_filename)); sub_folder = strchr (path, '@'); - if (!sub_folder) + if (!sub_folder) { + g_free (path); return; + } for (i = 0; i < sizeof (popup_items) / sizeof (popup_items[0]); i++) menus = g_slist_prepend (menus, &popup_items[i]); -- cgit v1.2.3