Slight improvement to previous commit. We're still storing
authorArt Cancro <ajc@citadel.org>
Sat, 11 Oct 2008 04:33:43 +0000 (04:33 +0000)
committerArt Cancro <ajc@citadel.org>
Sat, 11 Oct 2008 04:33:43 +0000 (04:33 +0000)
base calendar events in memory that are out of scope, but we're no longer
storing recurrences that are out of scope.

webcit/calendar.c

index 5daee196db08d442c427a04fe619964b499ed98b..ff569e4dbac0c7cd3a1d205b079574992b8a54c8 100644 (file)
@@ -530,14 +530,21 @@ void display_individual_cal(icalcomponent *cal, long msgnum, char *from, int unr
                                icalcomponent_add_property(Cal->cal, ps);
                        }
        
-                       Put(WCC->disp_cal_items, 
-                               (char*) &Cal->event_start,
-                               sizeof(Cal->event_start), 
-                               Cal, 
-                               delete_cal);
+                       if ( (Cal->event_start > calv->lower_bound)
+                          && (Cal->event_start < calv->upper_bound) ) {
+                               Put(WCC->disp_cal_items, 
+                                       (char*) &Cal->event_start,
+                                       sizeof(Cal->event_start), 
+                                       Cal, 
+                                       delete_cal
+                               );
+                       }
+                       else {
+                               delete_cal(Cal);
+                       }
 
                        /* If an upper bound is set, stop when we go out of scope */
-                       if (calv) if (final_recurrence > calv->upper_bound) stop_rr = 1;
+                       if (final_recurrence > calv->upper_bound) stop_rr = 1;
                }
        }
        lprintf(9, "Performed %d recurrences; final one is %s", num_recur, ctime(&final_recurrence));