[evolution-mapi/evolution-mapi-3-12] Bug 738512 - Build break with OpenChange 2.2
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-mapi/evolution-mapi-3-12] Bug 738512 - Build break with OpenChange 2.2
- Date: Tue, 14 Oct 2014 12:43:59 +0000 (UTC)
commit e885e5246d9f33e380f8c53c727a7cfc07acbbbe
Author: Milan Crha <mcrha redhat com>
Date: Tue Oct 14 14:40:41 2014 +0200
Bug 738512 - Build break with OpenChange 2.2
OpenChange 2.2 replaced MAPI_E_NETWORK_ERROR code with ecRpcFailed code,
which required changes on the evolution-mapi side.
configure.ac | 17 +++++++++++++++++
src/addressbook/e-book-backend-mapi.c | 6 +++---
src/calendar/e-cal-backend-mapi.c | 6 +++---
src/camel/camel-mapi-store.c | 6 +++---
src/libexchangemapi/e-mapi-connection.c | 2 +-
5 files changed, 27 insertions(+), 10 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 7e46929..962f3da 100644
--- a/configure.ac
+++ b/configure.ac
@@ -203,6 +203,23 @@ LIBS=$save_libs
AC_MSG_RESULT([$ac_cv_have_ftt21])
dnl ****************************
+dnl Check for OpenChange 2.2 ecRpcFailed
+dnl ****************************
+AC_MSG_CHECKING([libmapi ecRpcFailed error code])
+save_cflags=$CFLAGS; CFLAGS=$LIBMAPI_CFLAGS
+save_libs=$LIBS; LIBS="$LIBMAPI_LIBS"
+AC_LINK_IFELSE([AC_LANG_PROGRAM(
+ [[#include <libmapi/libmapi.h>]],
+ [[uint32_t err = ecRpcFailed;]])],
+ [AC_DEFINE(HAVE_ECPRCFAILED_ERROR, 1, [libmapi defines ecRpcFailed error code])
ac_cv_have_ecrpcfailed=yes],[ac_cv_have_ecrpcfailed=no])
+CFLAGS=$save_cflags
+LIBS=$save_libs
+if [ test "x$ac_cv_have_ecrpcfailed" = "xno" ] ; then
+ CFLAGS="-DecRpcFailed=MAPI_E_NETWORK_ERROR $CFLAGS"
+fi
+AC_MSG_RESULT([$ac_cv_have_ecrpcfailed])
+
+dnl ****************************
dnl Expose version information
dnl ****************************
API_VERSION=$EDS_PACKAGE
diff --git a/src/addressbook/e-book-backend-mapi.c b/src/addressbook/e-book-backend-mapi.c
index d94b9b7..af336d9 100644
--- a/src/addressbook/e-book-backend-mapi.c
+++ b/src/addressbook/e-book-backend-mapi.c
@@ -466,10 +466,10 @@ e_book_backend_mapi_maybe_disconnect (EBookBackendMAPI *ebma,
if (!mapi_error || !ebma->priv->conn)
return;
- if (g_error_matches (mapi_error, E_MAPI_ERROR, MAPI_E_NETWORK_ERROR) ||
+ if (g_error_matches (mapi_error, E_MAPI_ERROR, ecRpcFailed) ||
g_error_matches (mapi_error, E_MAPI_ERROR, MAPI_E_CALL_FAILED)) {
e_mapi_connection_disconnect (ebma->priv->conn,
- !g_error_matches (mapi_error, E_MAPI_ERROR, MAPI_E_NETWORK_ERROR),
+ !g_error_matches (mapi_error, E_MAPI_ERROR, ecRpcFailed),
NULL, NULL);
g_object_unref (ebma->priv->conn);
ebma->priv->conn = NULL;
@@ -1721,7 +1721,7 @@ mapi_error_to_edb_error (GError **perror, const GError *mapi_error, EDataBookSta
case MAPI_E_PASSWORD_EXPIRED:
code = E_DATA_BOOK_STATUS_AUTHENTICATION_REQUIRED;
break;
- case MAPI_E_NETWORK_ERROR:
+ case ecRpcFailed:
code = E_DATA_BOOK_STATUS_REPOSITORY_OFFLINE;
break;
default:
diff --git a/src/calendar/e-cal-backend-mapi.c b/src/calendar/e-cal-backend-mapi.c
index e1c96a5..d611ba3 100644
--- a/src/calendar/e-cal-backend-mapi.c
+++ b/src/calendar/e-cal-backend-mapi.c
@@ -179,7 +179,7 @@ mapi_error_to_edc_error (GError **perror, const GError *mapi_error, EDataCalCall
case MAPI_E_PASSWORD_EXPIRED:
code = AuthenticationRequired;
break;
- case MAPI_E_NETWORK_ERROR:
+ case ecRpcFailed:
code = RepositoryOffline;
break;
default:
@@ -1304,10 +1304,10 @@ e_cal_backend_mapi_maybe_disconnect (ECalBackendMAPI *cbma,
if (!mapi_error || !cbma->priv->conn)
return;
- if (g_error_matches (mapi_error, E_MAPI_ERROR, MAPI_E_NETWORK_ERROR) ||
+ if (g_error_matches (mapi_error, E_MAPI_ERROR, ecRpcFailed) ||
g_error_matches (mapi_error, E_MAPI_ERROR, MAPI_E_CALL_FAILED)) {
e_mapi_connection_disconnect (cbma->priv->conn,
- !g_error_matches (mapi_error, E_MAPI_ERROR, MAPI_E_NETWORK_ERROR),
+ !g_error_matches (mapi_error, E_MAPI_ERROR, ecRpcFailed),
NULL, NULL);
g_object_unref (cbma->priv->conn);
cbma->priv->conn = NULL;
diff --git a/src/camel/camel-mapi-store.c b/src/camel/camel-mapi-store.c
index 569de26..e711b1c 100644
--- a/src/camel/camel-mapi-store.c
+++ b/src/camel/camel-mapi-store.c
@@ -2653,7 +2653,7 @@ mapi_authenticate_sync (CamelService *service,
if (camel_mapi_settings_get_listen_notifications (mapi_settings))
e_mapi_connection_enable_notifications (store->priv->connection, NULL, 0, NULL, NULL);
} else if (g_error_matches (mapi_error, E_MAPI_ERROR, MAPI_E_LOGON_FAILED) ||
- g_error_matches (mapi_error, E_MAPI_ERROR, MAPI_E_NETWORK_ERROR)) {
+ g_error_matches (mapi_error, E_MAPI_ERROR, ecRpcFailed)) {
g_clear_error (&mapi_error);
result = CAMEL_AUTHENTICATION_REJECTED;
} else {
@@ -2757,10 +2757,10 @@ camel_mapi_store_maybe_disconnect (CamelMapiStore *mapi_store,
}
g_rec_mutex_unlock (&mapi_store->priv->connection_lock);
- if (g_error_matches (mapi_error, E_MAPI_ERROR, MAPI_E_NETWORK_ERROR) ||
+ if (g_error_matches (mapi_error, E_MAPI_ERROR, ecRpcFailed) ||
g_error_matches (mapi_error, E_MAPI_ERROR, MAPI_E_CALL_FAILED))
camel_service_disconnect_sync (CAMEL_SERVICE (mapi_store),
- !g_error_matches (mapi_error, E_MAPI_ERROR, MAPI_E_NETWORK_ERROR),
+ !g_error_matches (mapi_error, E_MAPI_ERROR, ecRpcFailed),
NULL, NULL);
}
diff --git a/src/libexchangemapi/e-mapi-connection.c b/src/libexchangemapi/e-mapi-connection.c
index 5ae1aab..ade9732 100644
--- a/src/libexchangemapi/e-mapi-connection.c
+++ b/src/libexchangemapi/e-mapi-connection.c
@@ -141,7 +141,7 @@ make_mapi_error (GError **perror, const gchar *context, enum MAPISTATUS mapi_sta
err (MAPI_E_SESSION_LIMIT, _("Cannot create more sessions, session limit was
reached"));
err (MAPI_E_USER_CANCEL, _("User cancelled operation"));
err (MAPI_E_UNABLE_TO_ABORT, _("Unable to abort"));
- err (MAPI_E_NETWORK_ERROR, _("Network error"));
+ err (ecRpcFailed, _("Network error"));
err (MAPI_E_DISK_ERROR, _("Disk error"));
err (MAPI_E_PASSWORD_CHANGE_REQUIRED, _("Password change required"));
err (MAPI_E_PASSWORD_EXPIRED, _("Password expired"));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]