Re: [evolution-patches] [calendar-plugins]: fix for bug #305627



Attached patch is the fix for bug #305627
please review.

Regards,
Dinesh


On Wed, 2005-08-10 at 16:49 +0530, Dinesh Layek wrote:
> attached patch is the fix for bug #305627
> please review.
> 
> Regards,
> Dinesh
> 
> _______________________________________________
> evolution-patches mailing list
> evolution-patches lists ximian com
> http://lists.ximian.com/mailman/listinfo/evolution-patches
Index: itip-formatter.c
===================================================================
RCS file: /cvs/gnome/evolution/plugins/itip-formatter/itip-formatter.c,v
retrieving revision 1.48
diff -u -p -r1.48 itip-formatter.c
--- itip-formatter.c	8 Aug 2005 20:34:22 -0000	1.48
+++ itip-formatter.c	11 Aug 2005 04:32:38 -0000
@@ -35,6 +35,8 @@
 #include <camel/camel-mime-message.h>
 #include <camel/camel-folder.h>
 #include <camel/camel-multipart.h>
+#include <camel/camel-service.h>
+#include <camel/camel-store.h>
 #include <libecal/e-cal.h>
 #include <libecal/e-cal-time-util.h>
 #include <libedataserverui/e-source-option-menu.h>
@@ -1755,8 +1757,52 @@ format_itip_object (EMFormatHTML *efh, G
 
 	if (pitip->calendar_uid)
 		pitip->current_ecal = start_calendar_server_by_uid (pitip, pitip->calendar_uid, pitip->type);
-	else
-		find_server (pitip, pitip->comp);
+	else {
+
+		/* Since the mailer uri matches with only groupwise calendar uri so for this case we need not have to call find_server */
+                CamelFolder *folder;
+                CamelStore *parent_store;
+                CamelService parent_object;
+                CamelURL *url;
+                char *uri;
+                GSList *groups, *l;
+                ESource *source;
+                gboolean found = FALSE;
+
+                folder = (((pitip->pobject).format)->format).folder;
+                parent_store = folder->parent_store;
+                parent_object = parent_store->parent_object;
+                url = parent_object.url;
+                uri = camel_url_to_string (url, CAMEL_URL_HIDE_ALL);
+
+                groups = e_source_list_peek_groups (pitip->source_lists[pitip->type]);
+                for (l = groups; l && !found; l = l->next) {
+                        ESourceGroup *group;
+                        GSList *sources, *m;
+
+                        group = l->data;
+                        sources = e_source_group_peek_sources (group);
+                        for (m = sources; m && !found; m = m->next) {
+                                source = m->data;
+                                if (!strcmp (uri, e_source_get_uri (source))) {
+                                        found = TRUE;
+                                        break;
+                                }
+                        }
+                }
+
+                if (found) {
+                        pitip->current_ecal = start_calendar_server (pitip, source, pitip->type, cal_opened_cb, pitip);
+                        itip_view_clear_lower_info_items (ITIP_VIEW (pitip->view));
+                        pitip->progress_info_id = 0;
+
+                        /* FIXME Check read only state of calendar? */
+                        itip_view_add_lower_info_item_printf (ITIP_VIEW (pitip->view), ITIP_VIEW_INFO_ITEM_TYPE_INFO,
+                                                      "Found the appointment in the calendar '%s'", e_source_peek_name (source));
+                        set_buttons_sensitive (pitip);
+                } else
+                        find_server (pitip, pitip->comp);
+	}
 	
 	return TRUE;
 }
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/plugins/itip-formatter/ChangeLog,v
retrieving revision 1.53
diff -u -p -r1.53 ChangeLog
--- ChangeLog	20 Jul 2005 15:40:54 -0000	1.53
+++ ChangeLog	11 Aug 2005 04:32:38 -0000
@@ -1,3 +1,9 @@
+2005-08-11  Dinesh Layek  <LDinesh novell com>
+
+	* itip-formatter.c: (find_cal_opened_cb): set the source calendar
+	of an appointment from the url information of CamelFolder for
+	the case of groupwise.
+
 2005-07-20  Chenthill Palanisamy  <pchenthill novell com>
 
 	* itip-formatter.c: (format_itip_object): Fixed a memory


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