aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/itip-formatter
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/itip-formatter')
-rw-r--r--plugins/itip-formatter/ChangeLog6
-rw-r--r--plugins/itip-formatter/itip-formatter.c45
2 files changed, 49 insertions, 2 deletions
diff --git a/plugins/itip-formatter/ChangeLog b/plugins/itip-formatter/ChangeLog
index fcc8fd9dde..2379aa180f 100644
--- a/plugins/itip-formatter/ChangeLog
+++ b/plugins/itip-formatter/ChangeLog
@@ -1,3 +1,9 @@
+2005-08-11 Dinesh Layek <LDinesh@novell.com>
+
+ Fixes #305627
+ * itip-formatter.c: (format_itip_object): set the source calendar
+ of an appointment from the url information of CamelFolder.
+
2005-08-09 Chenthill Palanisamy <pchenthill@novell.com>
Fixes #307841
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 <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,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;
}