1.1 --- a/imiptools/handlers/person.py Tue Apr 19 21:57:44 2016 +0200
1.2 +++ b/imiptools/handlers/person.py Tue Apr 19 23:44:33 2016 +0200
1.3 @@ -214,6 +214,18 @@
1.4 # Update free/busy details for the event.
1.5
1.6 self.update_event_in_freebusy(for_organiser=True)
1.7 +
1.8 + # Produce a REQUEST for the created occurrence for other
1.9 + # attendees of the parent event.
1.10 +
1.11 + obj = self.get_parent_object()
1.12 + stored_attendees = set(obj.get_values("ATTENDEE"))
1.13 + attendees = stored_attendees.difference(attendees)
1.14 +
1.15 + for attendee in attendees:
1.16 + methods, parts = self.get_message_parts(self.obj, "REQUEST", attendee)
1.17 + self.add_results(methods, [get_address(attendee)], parts)
1.18 +
1.19 return True
1.20
1.21 # Merge the attendance for the received object.
2.1 --- a/tests/test_person_invitation_decline_instance.sh Tue Apr 19 21:57:44 2016 +0200
2.2 +++ b/tests/test_person_invitation_decline_instance.sh Tue Apr 19 23:44:33 2016 +0200
2.3 @@ -250,6 +250,34 @@
2.4 && echo "Success" \
2.5 || echo "Failed"
2.6
2.7 +# This should cause the organiser to tell the second user about the recurrence.
2.8 +
2.9 + grep -q 'METHOD:REQUEST' out6.tmp \
2.10 +&& echo "Success" \
2.11 +|| echo "Failed"
2.12 +
2.13 + "$PERSON_SCRIPT" $ARGS < out6.tmp 2>> $ERROR \
2.14 +| "$SHOWMAIL" \
2.15 +> out62.tmp
2.16 +
2.17 + "$LIST_SCRIPT" $LIST_ARGS "$USER2" "object" "event26@example.com" \
2.18 +> out6O2.tmp
2.19 +
2.20 + "$LIST_SCRIPT" $LIST_ARGS "$USER2" "recurrence" "event26@example.com" "20141011T100000" \
2.21 +> out6R2.tmp
2.22 +
2.23 +# The second user's schedule should remain unchanged.
2.24 +# NOTE: The nature of the periods might need to change, with the recurrence
2.25 +# NOTE: taking over the affected period.
2.26 +
2.27 + "$LIST_SCRIPT" $LIST_ARGS "$USER2" "freebusy" \
2.28 +> out6f2.tmp
2.29 +
2.30 + [ `grep "event26@example.com" "out6f2.tmp" | wc -l` = '2' ] \
2.31 +&& grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out6f2.tmp" \
2.32 +&& echo "Success" \
2.33 +|| echo "Failed"
2.34 +
2.35 # Test recurrence acceptance in the outgoing handler.
2.36
2.37 "$ACCEPT_SCRIPT" $ACCEPT_ARGS "$USER1" "20141011T100000" "20141011T110000" "event26@example.com" "20141011T100000" 2>> $ERROR \
2.38 @@ -321,3 +349,43 @@
2.39 && grep -q 'event26@example.com' "out8R.tmp" \
2.40 && echo "Success" \
2.41 || echo "Failed"
2.42 +
2.43 +# Test recurrence declining in the outgoing handler.
2.44 +# Now the second user declines the parent event.
2.45 +
2.46 + "$DECLINE_SCRIPT" $DECLINE_ARGS "$USER2" "event26@example.com" 2>> $ERROR \
2.47 +| tee out9.tmp \
2.48 +| "$OUTGOING_SCRIPT" $ARGS 2>> $ERROR
2.49 +
2.50 + "$LIST_SCRIPT" $LIST_ARGS "$USER2" "freebusy" \
2.51 +> out9s.tmp
2.52 +
2.53 + [ `grep "event26@example.com" "out9s.tmp" | wc -l` = '0' ] \
2.54 +&& ! grep -q "^20141010T080000Z${TAB}20141010T090000Z" "out9s.tmp" \
2.55 +&& ! grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out9s.tmp" \
2.56 +&& echo "Success" \
2.57 +|| echo "Failed"
2.58 +
2.59 +# Test declining in the incoming handler.
2.60 +
2.61 + "$PERSON_SCRIPT" $ARGS < out9.tmp 2>> $ERROR \
2.62 +| "$SHOWMAIL" \
2.63 +> out10.tmp
2.64 +
2.65 + "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "freebusy" \
2.66 +> out10f.tmp
2.67 +
2.68 + [ `grep "event26@example.com" "out10f.tmp" | wc -l` = '2' ] \
2.69 +&& grep -q "^20141010T080000Z${TAB}20141010T090000Z" "out10f.tmp" \
2.70 +&& grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out10f.tmp" \
2.71 +&& echo "Success" \
2.72 +|| echo "Failed"
2.73 +
2.74 + "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "freebusy_other" "$USER2" \
2.75 +> out10o.tmp
2.76 +
2.77 + [ `grep "event26@example.com" "out10o.tmp" | wc -l` = '1' ] \
2.78 +&& ! grep -q "^20141010T080000Z${TAB}20141010T090000Z" "out10o.tmp" \
2.79 +&& grep -q "^20141011T080000Z${TAB}20141011T090000Z" "out10o.tmp" \
2.80 +&& echo "Success" \
2.81 +|| echo "Failed"