From 2740e3d13d2d1d663399e11a23b46128ee1a7f62 Mon Sep 17 00:00:00 2001 From: Chenthill Palanisamy Date: Fri, 12 Aug 2005 14:25:20 +0000 Subject: Fixes #305627. svn path=/trunk/; revision=30098 --- plugins/itip-formatter/itip-formatter.c | 45 +++++++++++++++++++++++++++++++-- 1 file changed, 43 insertions(+), 2 deletions(-) (limited to 'plugins/itip-formatter/itip-formatter.c') diff --git a/plugins/itip-formatter/itip-formatter.c b/plugins/itip-formatter/itip-formatter.c index b2bccca3b0..4ed6cdc342 100644 --- a/plugins/itip-formatter/itip-formatter.c +++ b/plugins/itip-formatter/itip-formatter.c @@ -35,6 +35,8 @@ #include #include #include +#include +#include #include #include #include @@ -1755,8 +1757,47 @@ format_itip_object (EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObject 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); + set_buttons_sensitive (pitip); + } else + find_server (pitip, pitip->comp); + } return TRUE; } -- cgit