aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/exchange-operations/exchange-operations.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/exchange-operations/exchange-operations.c')
-rw-r--r--plugins/exchange-operations/exchange-operations.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/plugins/exchange-operations/exchange-operations.c b/plugins/exchange-operations/exchange-operations.c
index d5f479cebc..b37473ae50 100644
--- a/plugins/exchange-operations/exchange-operations.c
+++ b/plugins/exchange-operations/exchange-operations.c
@@ -22,9 +22,29 @@
#include <string.h>
#include "exchange-operations.h"
+#include <e-util/e-error.h>
ExchangeConfigListener *exchange_global_config_listener=NULL;
+static char *error_ids[] = { "config-error",
+ "password-weak-error",
+ "password-change-error",
+ "password-change-success",
+ "account-offline",
+ "password-incorrect",
+ "account-domain-error",
+ "account-mailbox-na",
+ "account-version-error",
+ "account-wss-error",
+ "account-no-mailbox",
+ "account-resolve-error",
+ "account-connect-error",
+ "password-expired",
+ "account-unknown-error",
+ "account-quota-error",
+ "account-quota-send-error",
+ "account-quota-warn" };
+
static void
free_exchange_listener (void)
{
@@ -166,3 +186,31 @@ exchange_operations_get_exchange_account (void)
return account;
}
+void
+exchange_operations_report_error (ExchangeAccount *account, ExchangeAccountResult result)
+{
+ gchar *error_string;
+
+ g_return_if_fail (account != NULL);
+
+ error_string = g_strconcat ("org-gnome-exchange-operations:", error_ids[result], NULL);
+
+ switch (result) {
+ case EXCHANGE_ACCOUNT_MAILBOX_NA:
+ e_error_run (NULL, error_string, exchange_account_get_username (account), NULL);
+ break;
+ case EXCHANGE_ACCOUNT_NO_MAILBOX:
+ e_error_run (NULL, error_string, exchange_account_get_username (account),
+ account->exchange_server, NULL);
+ break;
+ case EXCHANGE_ACCOUNT_RESOLVE_ERROR:
+ case EXCHANGE_ACCOUNT_CONNECT_ERROR:
+ case EXCHANGE_ACCOUNT_UNKNOWN_ERROR:
+ e_error_run (NULL, error_string, account->exchange_server, NULL);
+ break;
+ default:
+ e_error_run (NULL, error_string, NULL);
+ }
+ g_free (error_string);
+}
+