[evolution-patches] Patch to Delete a calendar item on Accepting or Declining



Hi,

Attached with this mail is the patch to delete a calendar item on
Accepting or Declining.

Thanks & Regards,
Sankar P
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/plugins/itip-formatter/ChangeLog,v
retrieving revision 1.39
diff -u -p -r1.39 ChangeLog
--- ChangeLog	25 Feb 2005 15:54:21 -0000	1.39
+++ ChangeLog	3 Mar 2005 07:17:44 -0000
@@ -1,3 +1,8 @@
+2005-03-03  Sankar P <psankar novell com>
+
+	* itip-formatter.c: (update_item):
+	Added code to delete a calendar item on Accepting or Declining
+
 2005-02-24  Björn Torkelsson  <torkel acc umu se>
 
 	* org-gnome-itip-formatter.eplug.in: Added author and description.
Index: itip-formatter.c
===================================================================
RCS file: /cvs/gnome/evolution/plugins/itip-formatter/itip-formatter.c,v
retrieving revision 1.38
diff -u -p -r1.38 itip-formatter.c
--- itip-formatter.c	2 Feb 2005 09:08:14 -0000	1.38
+++ itip-formatter.c	3 Mar 2005 07:17:45 -0000
@@ -35,6 +35,7 @@
 #include <camel/camel-mime-message.h>
 #include <camel/camel-folder.h>
 #include <camel/camel-multipart.h>
+#include <camel/camel-url.h>
 #include <libecal/e-cal.h>
 #include <libecal/e-cal-time-util.h>
 #include <libedataserverui/e-source-option-menu.h>
@@ -763,27 +764,60 @@ update_item (FormatItipPObject *pitip, I
 		itip_view_clear_lower_info_items (ITIP_VIEW (pitip->view));
 
 		switch (response) {
-		case ITIP_VIEW_RESPONSE_ACCEPT:
-			itip_view_add_lower_info_item_printf (ITIP_VIEW (pitip->view), ITIP_VIEW_INFO_ITEM_TYPE_INFO, 
-							      _("Sent to calendar '%s' as accepted"), e_source_peek_name (source));
-			break;
-		case ITIP_VIEW_RESPONSE_TENTATIVE:
-			itip_view_add_lower_info_item_printf (ITIP_VIEW (pitip->view), ITIP_VIEW_INFO_ITEM_TYPE_INFO, 
-							      _("Sent to calendar '%s' as tentative"), e_source_peek_name (source));
-			break;
-		case ITIP_VIEW_RESPONSE_DECLINE:
-			/* FIXME some calendars just might not save it at all, is this accurate? */
-			itip_view_add_lower_info_item_printf (ITIP_VIEW (pitip->view), ITIP_VIEW_INFO_ITEM_TYPE_INFO, 
-							      _("Sent to calendar '%s' as declined"), e_source_peek_name (source));
-			break;
-		case ITIP_VIEW_RESPONSE_CANCEL:
-			/* FIXME some calendars just might not save it at all, is this accurate? */
-			itip_view_add_lower_info_item_printf (ITIP_VIEW (pitip->view), ITIP_VIEW_INFO_ITEM_TYPE_INFO, 
-							      _("Sent to calendar '%s' as cancelled"), e_source_peek_name (source));
-			break;
-		default:
-			g_assert_not_reached ();
-			break;
+			case ITIP_VIEW_RESPONSE_ACCEPT: 
+				{
+					char *str;
+					CamelFolder *folder = ((EMFormat *) pitip->pobject.format)->folder;
+					itip_view_add_lower_info_item_printf (ITIP_VIEW (pitip->view), ITIP_VIEW_INFO_ITEM_TYPE_INFO, 
+							_("Sent to calendar '%s' as accepted"), e_source_peek_name (source));
+					str = camel_service_get_url((CamelService *)folder->parent_store);
+					if (!g_ascii_strncasecmp("groupwise",str,9))
+					{
+						char *uid;
+						CamelFolderChangeInfo *changes = NULL;
+						changes = camel_folder_change_info_new ();
+						uid=((EMFormat *) pitip->pobject.format)->uid;
+						camel_folder_summary_remove_uid(folder->summary,uid);
+						camel_folder_change_info_remove_uid(changes,uid);
+						camel_object_trigger_event (folder, "folder_changed", changes);
+						camel_folder_change_info_free (changes) ;	
+					}
+					g_free(str);
+				}	
+				break;
+			case ITIP_VIEW_RESPONSE_TENTATIVE:
+				itip_view_add_lower_info_item_printf (ITIP_VIEW (pitip->view), ITIP_VIEW_INFO_ITEM_TYPE_INFO, 
+						_("Sent to calendar '%s' as tentative"), e_source_peek_name (source));
+				break;
+			case ITIP_VIEW_RESPONSE_DECLINE:
+				{
+					char *str;
+					CamelFolder *folder = ((EMFormat *) pitip->pobject.format)->folder;
+					itip_view_add_lower_info_item_printf (ITIP_VIEW (pitip->view), ITIP_VIEW_INFO_ITEM_TYPE_INFO, 
+							_("Sent to calendar '%s' as declined"), e_source_peek_name (source));
+					str = camel_service_get_url((CamelService *)folder->parent_store);
+					if (!g_ascii_strncasecmp("groupwise",str,9))
+					{
+						char *uid;
+						CamelFolderChangeInfo *changes = NULL;
+						changes = camel_folder_change_info_new ();
+						uid=((EMFormat *) pitip->pobject.format)->uid;
+						camel_folder_summary_remove_uid(folder->summary,uid);
+						camel_folder_change_info_remove_uid(changes,uid);
+						camel_object_trigger_event (folder, "folder_changed", changes);
+						camel_folder_change_info_free (changes) ;	
+					}
+					g_free(str);
+				}	
+				break;
+			case ITIP_VIEW_RESPONSE_CANCEL:
+				/* FIXME some calendars just might not save it at all, is this accurate? */
+				itip_view_add_lower_info_item_printf (ITIP_VIEW (pitip->view), ITIP_VIEW_INFO_ITEM_TYPE_INFO, 
+						_("Sent to calendar '%s' as cancelled"), e_source_peek_name (source));
+				break;
+			default:
+				g_assert_not_reached ();
+				break;
 		}
 
 		/* FIXME Should we hide or desensitize the buttons now? */


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