[evolution/gnome-3-2] Downstream bug Bnc#688711 unable to book resource



commit 1f791069266f2c65e94b06937fe1f08b8d6dc2d2
Author: Veerapuram Varadhan <vvaradhan novell com>
Date:   Fri Oct 14 15:58:50 2011 +0530

    Downstream bug Bnc#688711 unable to book resource

 calendar/gui/itip-utils.c |   19 ++++++++++++++++++-
 1 files changed, 18 insertions(+), 1 deletions(-)
---
diff --git a/calendar/gui/itip-utils.c b/calendar/gui/itip-utils.c
index c2fa19b..187757c 100644
--- a/calendar/gui/itip-utils.c
+++ b/calendar/gui/itip-utils.c
@@ -39,6 +39,8 @@
 
 #include <composer/e-msg-composer.h>
 
+#define d(x)
+
 static const gchar *itip_methods[] = {
 	"PUBLISH",
 	"REQUEST",
@@ -574,8 +576,15 @@ comp_to_list (ECalComponentItipMethod method,
 		for (l = attendees; l != NULL; l = l->next) {
 			ECalComponentAttendee *att = l->data;
 
+			/* Bugfix: 688711 - Varadhan
+			   Resource is also considered as a "attendee". If the respective backend
+			   is able to successfully book resources automagically, it will appear
+			   in the users list and thereby won't get added to the list of destinations
+			   to send the meeting invite, otherwise, as a safety measure, a meeting
+			   invite will be sent to the resources as well. */
 			if (att->cutype != ICAL_CUTYPE_INDIVIDUAL &&
-			    att->cutype != ICAL_CUTYPE_GROUP)
+			    att->cutype != ICAL_CUTYPE_GROUP &&
+			    att->cutype != ICAL_CUTYPE_RESOURCE)
 				continue;
 			else if (users_has_attendee (users, att->value))
 				continue;
@@ -606,6 +615,9 @@ comp_to_list (ECalComponentItipMethod method,
 			e_destination_set_email (
 				destination, itip_strip_mailto (att->value));
 			g_ptr_array_add (array, destination);
+			d(printf ("itip-utils.c: comp_to_list: name: %s, email: %s\n",
+				  e_destination_get_name (destination),
+				  e_destination_get_email (destination)));
 		}
 		g_free (sender);
 		e_cal_component_free_attendee_list (attendees);
@@ -961,8 +973,10 @@ comp_server_send (ECalComponentItipMethod method,
 	GError *error = NULL;
 
 	top_level = comp_toplevel_with_zones (method, comp, cal_client, zones);
+	d(printf ("itip-utils.c: comp_server_send: calling e_cal_send_objects... \n"));
 	if (!e_cal_client_send_objects_sync (cal_client, top_level, users, &returned_icalcomp, NULL, &error)) {
 		/* FIXME Really need a book problem status code */
+		d(printf ("itip-utils.c: return value from e_cal_send_objects is: %d", error->code));
 		if (error) {
 			if (g_error_matches (error, E_CAL_CLIENT_ERROR, E_CAL_CLIENT_ERROR_OBJECT_ID_ALREADY_EXISTS)) {
 				e_notice (
@@ -979,6 +993,8 @@ comp_server_send (ECalComponentItipMethod method,
 
 			retval = FALSE;
 		}
+	} else {
+	  d(printf ("itip-utils.c: e_cal_send_objects returned without errors\n"));
 	}
 
 	g_clear_error (&error);
@@ -1505,6 +1521,7 @@ itip_send_comp (ECalComponentItipMethod method,
 
 	/* Give the server a chance to manipulate the comp */
 	if (method != E_CAL_COMPONENT_METHOD_PUBLISH) {
+		d(printf ("itip-utils.c: itip_send_comp: calling comp_server_send... \n"));
 		if (!comp_server_send (method, send_comp, cal_client, zones, &users))
 			goto cleanup;
 	}



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