[evolution-mapi] Bug #601484 - Cannot accept a meeting request



commit b1555e2fe412647fb775fe238cc81b18039d3c0c
Author: Milan Crha <mcrha redhat com>
Date:   Mon Feb 15 12:29:21 2010 +0100

    Bug #601484 - Cannot accept a meeting request

 src/calendar/e-cal-backend-mapi.c              |   17 ++++++++++++++---
 src/libexchangemapi/exchange-mapi-connection.c |    2 +-
 2 files changed, 15 insertions(+), 4 deletions(-)
---
diff --git a/src/calendar/e-cal-backend-mapi.c b/src/calendar/e-cal-backend-mapi.c
index e48a8ba..188cca6 100644
--- a/src/calendar/e-cal-backend-mapi.c
+++ b/src/calendar/e-cal-backend-mapi.c
@@ -1868,7 +1868,7 @@ e_cal_backend_mapi_send_objects (ECalBackendSync *backend, EDataCal *cal, const
 		icalcomponent *subcomp = icalcomponent_get_first_component (icalcomp, kind);
 		while (subcomp) {
 			ECalComponent *comp = e_cal_component_new ();
-			struct cbdata cbdata;
+			struct cbdata cbdata = { 0 };
 			mapi_id_t mid = 0;
 			GSList *recipients = NULL;
 			GSList *attachments = NULL;
@@ -2022,8 +2022,19 @@ e_cal_backend_mapi_receive_objects (ECalBackendSync *backend, EDataCal *cal, con
 
 			switch (method) {
 			case ICAL_METHOD_REQUEST :
-				comp_str = e_cal_component_get_as_string (comp);
-				status = e_cal_backend_mapi_modify_object (backend, cal, comp_str, CALOBJ_MOD_THIS, &old_object, &new_object);
+				comp_str = NULL;
+				status = e_cal_backend_mapi_get_object (backend, cal, uid, NULL, &comp_str);
+				if (status != GNOME_Evolution_Calendar_Success) {
+					comp_str = e_cal_component_get_as_string (comp);
+					new_object = comp_str;
+					status = e_cal_backend_mapi_create_object (backend, cal, &new_object, NULL);
+					if (new_object == comp_str)
+						new_object = NULL;
+				} else {
+					g_free (comp_str);
+					comp_str = e_cal_component_get_as_string (comp);
+					status = e_cal_backend_mapi_modify_object (backend, cal, comp_str, CALOBJ_MOD_ALL, &old_object, &new_object);
+				}
 				g_free (comp_str);
 				g_free (old_object);
 				g_free (new_object);
diff --git a/src/libexchangemapi/exchange-mapi-connection.c b/src/libexchangemapi/exchange-mapi-connection.c
index b574863..a9dcf31 100644
--- a/src/libexchangemapi/exchange-mapi-connection.c
+++ b/src/libexchangemapi/exchange-mapi-connection.c
@@ -112,7 +112,7 @@ mapi_profile_load (const char *profname, const char *password)
 	}
 
 	/* Initialize libmapi logger*/
-	if (g_getenv ("LIBMAPI_DEBUG")) {
+	if (g_getenv ("MAPI_DEBUG")) {
 		debug_log_level = atoi (g_getenv ("MAPI_DEBUG"));
 		SetMAPIDumpData(TRUE);
 		SetMAPIDebugLevel(debug_log_level);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]