From 3ac318fdb03e47fccecb5291ef28d2cc4063cc02 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Sat, 11 Oct 2008 04:33:43 +0000 Subject: [PATCH] Slight improvement to previous commit. We're still storing 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 | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/webcit/calendar.c b/webcit/calendar.c index 5daee196d..ff569e4db 100644 --- a/webcit/calendar.c +++ b/webcit/calendar.c @@ -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)); -- 2.39.2