* serv_calendar.c: beforesave hook now looks for the UID inside nested
authorArt Cancro <ajc@citadel.org>
Thu, 3 Feb 2005 04:36:57 +0000 (04:36 +0000)
committerArt Cancro <ajc@citadel.org>
Thu, 3 Feb 2005 04:36:57 +0000 (04:36 +0000)
  VTODO components, in addition to VCALENDAR components.

citadel/ChangeLog
citadel/serv_calendar.c

index 166d045f26878f7b99ee70c4248ab193eb90c6b6..52677ddd6c790589f9a189b95e01fb8b587d38b4 100644 (file)
@@ -1,4 +1,8 @@
  $Log$
+ Revision 630.12  2005/02/03 04:36:56  ajc
+ * serv_calendar.c: beforesave hook now looks for the UID inside nested
+   VTODO components, in addition to VCALENDAR components.
+
  Revision 630.11  2005/02/01 23:11:46  ajc
  * new ENT0 syntax now also outputs EUID
 
@@ -6342,3 +6346,4 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import
+
index 2e4eb50840b27d5d090cbfb605aa0de98381f3bf..65ec59f7ac9d8d378409b92aa05bd1c0c65ac9cf 100644 (file)
@@ -1667,7 +1667,7 @@ void ical_ctdl_set_exclusive_msgid(char *name, char *filename, char *partnum,
                char *disp, void *content, char *cbtype, size_t length,
                char *encoding, void *cbuserdata)
 {
-       icalcomponent *cal;
+       icalcomponent *cal, *nested_event, *nested_todo;
        icalproperty *p;
        struct icalmessagemod *imm;
        char new_uid[SIZ];
@@ -1683,9 +1683,18 @@ void ical_ctdl_set_exclusive_msgid(char *name, char *filename, char *partnum,
                cal = icalcomponent_new_from_string(content);
                if (cal != NULL) {
                        if (icalcomponent_isa(cal) == ICAL_VCALENDAR_COMPONENT) {
-                               cal = icalcomponent_get_first_component(
+                               nested_event = icalcomponent_get_first_component(
                                        cal, ICAL_VEVENT_COMPONENT
                                );
+                               nested_todo = icalcomponent_get_first_component(
+                                       cal, ICAL_VTODO_COMPONENT
+                               );
+                               if (nested_event != NULL) {
+                                       cal = nested_event;
+                               }
+                               else if (nested_todo != NULL) {
+                                       cal = nested_todo;
+                               }
                        }
                }
                if (cal != NULL) {