# HG changeset patch # User Paul Boddie # Date 1411497721 -7200 # Node ID 19d6312453bed7173056bafd85878e228c99bcd5 # Parent 4018cd604f93cca203e4d01a342ff02f83daa7f0 Added a missing test for periods against earlier events. diff -r 4018cd604f93 -r 19d6312453be imip_agent.py --- a/imip_agent.py Tue Sep 23 20:35:51 2014 +0200 +++ b/imip_agent.py Tue Sep 23 20:42:01 2014 +0200 @@ -127,7 +127,11 @@ def period_overlaps(freebusy, period): dtstart, dtend = period[:2] i = bisect_left(freebusy, (dtstart, dtend, None)) - return i < len(freebusy) and (dtend is None or freebusy[i][0] < dtend) + return ( + i < len(freebusy) and (dtend is None or freebusy[i][0] < dtend) + or + i > 0 and freebusy[i - 1] > dtstart + ) # Sending of outgoing messages.