projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a0bffa3
)
ical_ctdl_is_overlap.c: cleaned it up
author
Art Cancro
<ajc@citadel.org>
Thu, 21 Mar 2024 18:50:21 +0000
(11:50 -0700)
committer
Art Cancro
<ajc@citadel.org>
Thu, 21 Mar 2024 18:50:21 +0000
(11:50 -0700)
citadel/server/modules/calendar/ical_ctdl_is_overlap.c
patch
|
blob
|
history
diff --git
a/citadel/server/modules/calendar/ical_ctdl_is_overlap.c
b/citadel/server/modules/calendar/ical_ctdl_is_overlap.c
index fbec0f572163919011f8da30e48428da83c837a1..30a0b166d5eabfdcfb9e87bab8ee38bab3e789dd 100644
(file)
--- a/
citadel/server/modules/calendar/ical_ctdl_is_overlap.c
+++ b/
citadel/server/modules/calendar/ical_ctdl_is_overlap.c
@@
-26,13
+26,9
@@
int ical_ctdl_is_overlap(
}
else {
if (t1end.is_date && icaltime_compare(t1start, t1end)) {
}
else {
if (t1end.is_date && icaltime_compare(t1start, t1end)) {
-
- // The end date is non-inclusive so adjust it by one
- // day because our test is inclusive, note that a day is
- // not too much because we are talking about all day events.
- //
- // If start = end we assume that nevertheless the whole day is meant.
-
+ // The end date is non-inclusive so adjust it by one day because our test is inclusive.
+ // Note that a day is not too much because we are talking about all day events.
+ // If start==end we assume that it means one day.
icaltime_adjust(&t1end, -1, 0, 0, 0);
}
}
icaltime_adjust(&t1end, -1, 0, 0, 0);
}
}
@@
-46,7
+42,6
@@
int ical_ctdl_is_overlap(
);
#endif
);
#endif
-
if (icaltime_is_null_time(t2end)) {
memcpy(&t2end, &t2start, sizeof(struct icaltimetype));
}
if (icaltime_is_null_time(t2end)) {
memcpy(&t2end, &t2start, sizeof(struct icaltimetype));
}
@@
-69,14
+64,13
@@
int ical_ctdl_is_overlap(
}
// Now check for overlaps using date *and* time.
}
// Now check for overlaps using date *and* time.
+ // We could probably implement this in terms of icaltime_span_overlaps() but this does the same thing.
// If event 1 ends before event 2 starts, there is no match.
if (icaltime_compare(t1end, t2start) <= 0) return(0);
// If event 1 ends before event 2 starts, there is no match.
if (icaltime_compare(t1end, t2start) <= 0) return(0);
- // syslog(LOG_DEBUG, "calendar: first passed");
// If event 2 ends before event 1 starts, there is no match.
if (icaltime_compare(t2end, t1start) <= 0) return(0);
// If event 2 ends before event 1 starts, there is no match.
if (icaltime_compare(t2end, t1start) <= 0) return(0);
- // syslog(LOG_DEBUG, "calendar: second passed");
// Otherwise, there is an overlap, so yes we have a match.
return(1);
// Otherwise, there is an overlap, so yes we have a match.
return(1);