# HG changeset patch # User Paul Boddie # Date 1411507798 -7200 # Node ID 13b56c9ce817bb2d12fdd37d8e11d65cb448e705 # Parent 4018cd604f93cca203e4d01a342ff02f83daa7f0 Added a missing test for periods against earlier events. diff -r 4018cd604f93 -r 13b56c9ce817 imip_agent.py --- a/imip_agent.py Tue Sep 23 20:35:51 2014 +0200 +++ b/imip_agent.py Tue Sep 23 23:29:58 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][1] > dtstart + ) # Sending of outgoing messages.