aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/itip-formatter
diff options
context:
space:
mode:
authorSankar P <psankar@novell.com>2006-06-16 21:12:00 +0800
committerSankarasivasubramanian Pasupathilingam <psankar@src.gnome.org>2006-06-16 21:12:00 +0800
commit36fbdf0872c921bd685f6984ec5405f8b9ab2fc5 (patch)
tree07a3da8d24dec55d7b8ae3410395051f7d740260 /plugins/itip-formatter
parenta65e7e64a3bfe7f3b3bee674791a354a0abadb18 (diff)
downloadgsoc2013-evolution-36fbdf0872c921bd685f6984ec5405f8b9ab2fc5.tar
gsoc2013-evolution-36fbdf0872c921bd685f6984ec5405f8b9ab2fc5.tar.gz
gsoc2013-evolution-36fbdf0872c921bd685f6984ec5405f8b9ab2fc5.tar.bz2
gsoc2013-evolution-36fbdf0872c921bd685f6984ec5405f8b9ab2fc5.tar.lz
gsoc2013-evolution-36fbdf0872c921bd685f6984ec5405f8b9ab2fc5.tar.xz
gsoc2013-evolution-36fbdf0872c921bd685f6984ec5405f8b9ab2fc5.tar.zst
gsoc2013-evolution-36fbdf0872c921bd685f6984ec5405f8b9ab2fc5.zip
Deletes a GroupWise appointment if accepted or deleted.
2006-06-16 Sankar P <psankar@novell.com> * itip-formatter.c: (view_response_cb): Deletes a GroupWise appointment if accepted or deleted. svn path=/trunk/; revision=32162
Diffstat (limited to 'plugins/itip-formatter')
-rw-r--r--plugins/itip-formatter/ChangeLog5
-rw-r--r--plugins/itip-formatter/itip-formatter.c90
2 files changed, 57 insertions, 38 deletions
diff --git a/plugins/itip-formatter/ChangeLog b/plugins/itip-formatter/ChangeLog
index cb8ccb93b3..51fb4b80c3 100644
--- a/plugins/itip-formatter/ChangeLog
+++ b/plugins/itip-formatter/ChangeLog
@@ -1,3 +1,8 @@
+2006-06-16 Sankar P <psankar@novell.com>
+
+ * itip-formatter.c: (view_response_cb):
+ Deletes a GroupWise appointment if accepted or deleted.
+
2006-06-16 Chenthill Palanisamy <pchenthill@novell.com>
Fixes #179774 (b.n.c)
diff --git a/plugins/itip-formatter/itip-formatter.c b/plugins/itip-formatter/itip-formatter.c
index 6d5f532206..b2fd0438b2 100644
--- a/plugins/itip-formatter/itip-formatter.c
+++ b/plugins/itip-formatter/itip-formatter.c
@@ -1407,7 +1407,7 @@ static void
view_response_cb (GtkWidget *widget, ItipViewResponse response, gpointer data)
{
FormatItipPObject *pitip = data;
- gboolean status = FALSE;
+ gboolean status = FALSE, delete_invitation_from_cache = FALSE;
icalproperty *prop;
ECalComponentTransparency trans;
@@ -1429,53 +1429,67 @@ view_response_cb (GtkWidget *widget, ItipViewResponse response, gpointer data)
}
switch (response) {
- case ITIP_VIEW_RESPONSE_ACCEPT:
- status = change_status (pitip->ical_comp, pitip->my_address,
+ case ITIP_VIEW_RESPONSE_ACCEPT:
+ status = change_status (pitip->ical_comp, pitip->my_address,
ICAL_PARTSTAT_ACCEPTED);
- if (status) {
- e_cal_component_rescan (pitip->comp);
- update_item (pitip, response);
- }
- break;
- case ITIP_VIEW_RESPONSE_TENTATIVE:
- status = change_status (pitip->ical_comp, pitip->my_address,
+ if (status) {
+ e_cal_component_rescan (pitip->comp);
+ update_item (pitip, response);
+ if (e_cal_get_save_schedules (pitip->current_ecal))
+ delete_invitation_from_cache = TRUE;
+ }
+ break;
+ case ITIP_VIEW_RESPONSE_TENTATIVE:
+ status = change_status (pitip->ical_comp, pitip->my_address,
ICAL_PARTSTAT_TENTATIVE);
- if (status) {
- e_cal_component_rescan (pitip->comp);
- update_item (pitip, response);
- }
- break;
- case ITIP_VIEW_RESPONSE_DECLINE:
- status = change_status (pitip->ical_comp, pitip->my_address,
+ if (status) {
+ e_cal_component_rescan (pitip->comp);
+ update_item (pitip, response);
+ if (e_cal_get_save_schedules (pitip->current_ecal))
+ delete_invitation_from_cache = TRUE;
+
+ }
+ break;
+ case ITIP_VIEW_RESPONSE_DECLINE:
+ status = change_status (pitip->ical_comp, pitip->my_address,
ICAL_PARTSTAT_DECLINED);
- if (status) {
- e_cal_component_rescan (pitip->comp);
+ if (status) {
+ e_cal_component_rescan (pitip->comp);
+ update_item (pitip, response);
+ if (e_cal_get_save_schedules (pitip->current_ecal))
+ delete_invitation_from_cache = TRUE;
+ }
+ break;
+ case ITIP_VIEW_RESPONSE_UPDATE:
+ update_attendee_status (pitip);
+ break;
+ case ITIP_VIEW_RESPONSE_CANCEL:
update_item (pitip, response);
- }
- break;
- case ITIP_VIEW_RESPONSE_UPDATE:
- update_attendee_status (pitip);
- break;
- case ITIP_VIEW_RESPONSE_CANCEL:
- update_item (pitip, response);
- break;
- case ITIP_VIEW_RESPONSE_REFRESH:
- send_item (pitip);
- break;
- case ITIP_VIEW_RESPONSE_OPEN:
- g_idle_add (idle_open_cb, pitip);
- return;
- default:
- break;
+ break;
+ case ITIP_VIEW_RESPONSE_REFRESH:
+ send_item (pitip);
+ break;
+ case ITIP_VIEW_RESPONSE_OPEN:
+ g_idle_add (idle_open_cb, pitip);
+ return;
+ default:
+ break;
+ }
+
+ if (delete_invitation_from_cache) {
+ CamelFolderChangeInfo *changes = NULL;
+ camel_folder_summary_remove_uid(((EMFormat *) pitip->pobject.format)->folder->summary, ((EMFormat *) pitip->pobject.format)->uid);
+ changes = camel_folder_change_info_new ();
+ camel_folder_change_info_remove_uid (changes, (char *)((EMFormat *) pitip->pobject.format)->uid);
+ camel_object_trigger_event (((EMFormat *) pitip->pobject.format)->folder, "folder_changed", changes);
+ camel_folder_change_info_free (changes);
}
- if (pitip->delete_message) {
+ if (!delete_invitation_from_cache && pitip->delete_message) {
g_message ("Deleting!");
camel_folder_delete_message (((EMFormat *) pitip->pobject.format)->folder, ((EMFormat *) pitip->pobject.format)->uid);
}
- if (e_cal_get_save_schedules (pitip->current_ecal))
- return;
if (itip_view_get_rsvp (ITIP_VIEW (pitip->view)) && status) {
ECalComponent *comp = NULL;