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.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/plugins/exchange-operations/exchange-operations.c b/plugins/exchange-operations/exchange-operations.c
index 23794a079b..b7b8b436e5 100644
--- a/plugins/exchange-operations/exchange-operations.c
+++ b/plugins/exchange-operations/exchange-operations.c
@@ -184,14 +184,25 @@ ExchangeAccount *
exchange_operations_get_exchange_account (void)
{
ExchangeAccount *account = NULL;
+ ExchangeAccountResult result;
GSList *acclist;
acclist = exchange_config_listener_get_accounts (exchange_global_config_listener);
/* FIXME: Need to be changed for handling multiple accounts */
- if (acclist)
+ if (acclist) {
account = acclist->data;
- return account;
+ if (exchange_account_get_context (account))
+ return account;
+ else {
+ /* Try authenticating */
+ result = exchange_config_listener_authenticate(exchange_global_config_listener, account);
+ if (exchange_account_get_context (account))
+ return account;
+ }
+ }
+
+ return NULL;
}
void