aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorPraveen Kumar <kpraveen@novell.com>2005-07-29 02:05:12 +0800
committerPraveen Kumar <kpraveen@src.gnome.org>2005-07-29 02:05:12 +0800
commit212865359e2f259ed2d8f181e0489a9507f7c55e (patch)
tree40dbddcd58f38ac4870650dc9e06fd9db960cc54 /plugins
parentca7deeb9eea67aa81e7881a35c9e141833f7fc2e (diff)
downloadgsoc2013-evolution-212865359e2f259ed2d8f181e0489a9507f7c55e.tar.gz
gsoc2013-evolution-212865359e2f259ed2d8f181e0489a9507f7c55e.tar.zst
gsoc2013-evolution-212865359e2f259ed2d8f181e0489a9507f7c55e.zip
Handle error conditions if folder subscription fails. Fixes bug 311712
2005-07-27 Praveen Kumar <kpraveen@novell.com> * exchange-folder.c (org_gnome_exchange_folder_subscription) : Handle error conditions if folder subscription fails. Fixes bug 311712 svn path=/trunk/; revision=29918
Diffstat (limited to 'plugins')
-rw-r--r--plugins/exchange-operations/ChangeLog5
-rw-r--r--plugins/exchange-operations/exchange-folder.c49
2 files changed, 33 insertions, 21 deletions
diff --git a/plugins/exchange-operations/ChangeLog b/plugins/exchange-operations/ChangeLog
index 017ea5aa20..c5a09144dc 100644
--- a/plugins/exchange-operations/ChangeLog
+++ b/plugins/exchange-operations/ChangeLog
@@ -1,3 +1,8 @@
+2005-07-27 Praveen Kumar <kpraveen@novell.com>
+
+ * exchange-folder.c (org_gnome_exchange_folder_subscription) : Handle
+ error conditions if folder subscription fails. Fixes bug 311712
+
2005-07-27 Harry Lu <harry.lu@sun.com>
Only show the unsubscribe menu if it is an exchange folder.
diff --git a/plugins/exchange-operations/exchange-folder.c b/plugins/exchange-operations/exchange-folder.c
index 139ead0fa8..8347cbe18e 100644
--- a/plugins/exchange-operations/exchange-folder.c
+++ b/plugins/exchange-operations/exchange-folder.c
@@ -33,6 +33,8 @@
#include <mail/em-popup.h>
#include <mail/em-menu.h>
#include <libedataserverui/e-source-selector.h>
+#include <e-util/e-error.h>
+
#include "exchange-operations.h"
#include "addressbook/gui/widgets/eab-popup.h"
#include "exchange-folder-subscription.h"
@@ -396,33 +398,38 @@ org_gnome_exchange_folder_subscription (EPlugin *ep, EMMenuTargetSelect *target)
create_folder_subscription_dialog (account->account_name, &user_email_address, &folder_name);
- if (user_email_address && folder_name)
+ if (user_email_address && folder_name) {
result = exchange_account_discover_shared_folder (account, user_email_address, folder_name, &folder);
+
+ switch (result) {
+ case EXCHANGE_ACCOUNT_FOLDER_ALREADY_EXISTS:
+ e_error_run (NULL, ERROR_DOMAIN ":folder-exists-error", NULL);
+ return;
+ case EXCHANGE_ACCOUNT_FOLDER_DOES_NOT_EXIST:
+ e_error_run (NULL, ERROR_DOMAIN ":folder-doesnt-exist-error", NULL);
+ return;
+ case EXCHANGE_ACCOUNT_FOLDER_UNKNOWN_TYPE:
+ e_error_run (NULL, ERROR_DOMAIN ":folder-unknown-type", NULL);
+ return;
+ case EXCHANGE_ACCOUNT_FOLDER_PERMISSION_DENIED:
+ e_error_run (NULL, ERROR_DOMAIN ":folder-perm-error", NULL);
+ return;
+ case EXCHANGE_ACCOUNT_FOLDER_OFFLINE:
+ e_error_run (NULL, ERROR_DOMAIN ":folder-offline-error", NULL);
+ return;
+ case EXCHANGE_ACCOUNT_FOLDER_UNSUPPORTED_OPERATION:
+ e_error_run (NULL, ERROR_DOMAIN ":folder-unsupported-error", NULL);
+ return;
+ case EXCHANGE_ACCOUNT_FOLDER_GENERIC_ERROR:
+ e_error_run (NULL, ERROR_DOMAIN ":folder-generic-error", NULL);
+ return;
+ }
+ }
if (!folder) {
return;
}
-#if 0
- hier = e_folder_exchange_get_hierarchy (folder);
- folder_display_name = g_strdup_printf ("%s's %s", hier->owner_name, folder_name);
- folder_type = (gchar *) e_folder_get_type_string (folder);
- physical_uri = (gchar *) e_folder_get_physical_uri (folder);
- if (!(strcmp (folder_type, "calendar")) ||
- !(strcmp (folder_type, "calendar/public"))) {
- add_folder_esource (account, EXCHANGE_CALENDAR_FOLDER, folder_display_name, physical_uri);
- }
- else if (!(strcmp (folder_type, "tasks")) ||
- !(strcmp (folder_type, "tasks/public"))) {
- add_folder_esource (account, EXCHANGE_TASKS_FOLDER, folder_display_name, physical_uri);
- }
- else if (!(strcmp (folder_type, "contacts")) ||
- !(strcmp (folder_type, "contacts/public")) ||
- !(strcmp (folder_type, "contacts/ldap"))) {
- add_folder_esource (account, EXCHANGE_CONTACTS_FOLDER, folder_display_name, physical_uri);
- }
- g_free (folder_display_name);
-#endif
exchange_account_open_folder (account, g_strdup_printf ("/%s", user_email_address));
}