+/*
+ * Phase 6 of "hunt for conflicts"
+ * called by ical_conflicts_phase5()
+ *
+ * Now both the proposed and existing events have been boiled down to start and end times.
+ * Check for overlap and output any conflicts.
+ */
+void ical_conflicts_phase6(struct icaltimetype t1start,
+ struct icaltimetype t1end,
+ struct icaltimetype t2start,
+ struct icaltimetype t2end,
+ long existing_msgnum,
+ char *conflict_event_uid,
+ char *conflict_event_summary,
+ char *compare_uid)
+{
+
+ /* debugging cruft */
+ time_t tt;
+ tt = icaltime_as_timet(t1start);
+ CtdlLogPrintf(CTDL_DEBUG, "PROPOSED START: %s", ctime(&tt));
+ tt = icaltime_as_timet(t1end);
+ CtdlLogPrintf(CTDL_DEBUG, " PROPOSED END: %s", ctime(&tt));
+ tt = icaltime_as_timet(t2start);
+ CtdlLogPrintf(CTDL_DEBUG, "EXISTING START: %s", ctime(&tt));
+ tt = icaltime_as_timet(t2end);
+ CtdlLogPrintf(CTDL_DEBUG, " EXISTING END: %s", ctime(&tt));
+
+ /* compare and output */
+
+ if (ical_ctdl_is_overlap(t1start, t1end, t2start, t2end)) {
+ cprintf("%ld||%s|%s|%d|\n",
+ existing_msgnum,
+ conflict_event_uid,
+ conflict_event_summary,
+ ( ((strlen(compare_uid)>0)
+ &&(!strcasecmp(compare_uid,
+ conflict_event_uid))) ? 1 : 0
+ )
+ );
+ CtdlLogPrintf(CTDL_DEBUG, " --- CONFLICT --- \n");
+ }
+ else {
+ CtdlLogPrintf(CTDL_DEBUG, " --- no conflict --- \n");
+ }
+
+}
+
+