summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2014-02-21 01:48:02 -0500
committerThomas Bruederli <bruederli@kolabsys.com>2014-02-21 01:48:02 -0500
commite5eb9d3a14aff55efc9921a575813cd5cbae4a35 (patch)
tree65247ccb83c989615eab7be6a6b841bacfb1f5c8
parent139192fc2cd52cfbacbf5319b0838a044d26bdbb (diff)
downloadpykolab-e5eb9d3a14aff55efc9921a575813cd5cbae4a35.tar.gz
Set Delegator to NON-PARTICIPANT and RSVP=FALSE according to RFC
-rw-r--r--tests/functional/test_wallace/test_005_resource_invitation.py2
-rw-r--r--wallace/module_resources.py9
2 files changed, 9 insertions, 2 deletions
diff --git a/tests/functional/test_wallace/test_005_resource_invitation.py b/tests/functional/test_wallace/test_005_resource_invitation.py
index 5afde3c..e464c73 100644
--- a/tests/functional/test_wallace/test_005_resource_invitation.py
+++ b/tests/functional/test_wallace/test_005_resource_invitation.py
@@ -318,7 +318,6 @@ class TestResourceInvitation(unittest.TestCase):
imap.imap.m.expunge()
imap.disconnect()
- time.sleep(1)
def find_resource_by_email(self, email):
@@ -380,6 +379,7 @@ class TestResourceInvitation(unittest.TestCase):
# resource collection responds with a DELEGATED message
response = self.check_message_received("Reservation Request for test was DELEGATED", self.cars['mail'])
self.assertIsInstance(response, email.message.Message)
+ self.assertIn("ROLE=NON-PARTICIPANT;RSVP=FALSE", str(response))
def test_005_rescheduling_reservation(self):
diff --git a/wallace/module_resources.py b/wallace/module_resources.py
index 6aaf64a..c987832 100644
--- a/wallace/module_resources.py
+++ b/wallace/module_resources.py
@@ -373,6 +373,11 @@ def execute(*args, **kw):
#
itip_event['xml'].delegate(original_resource['mail'], _target_resource['mail'], _target_resource['cn'])
+ # set delegator to NON-PARTICIPANT and RSVP=FALSE
+ delegator = itip_event['xml'].get_attendee_by_email(original_resource['mail'])
+ delegator.set_role(kolabformat.NonParticipant)
+ delegator.set_rsvp(False)
+
accept_reservation_request(itip_event, _target_resource, original_resource)
done = True
@@ -437,6 +442,8 @@ def read_resource_calendar(resource_rec, itip_events):
_ee = to_dt(event.get_end())
_ie = to_dt(itip['end'].dt)
+ # TODO: add margin for all-day dates (+13h; -12h)
+
if _es < _is:
if _es <= _ie:
if _ee <= _is:
@@ -457,7 +464,7 @@ def read_resource_calendar(resource_rec, itip_events):
resource_rec['existing_events'].append(itip['uid'])
# don't register conflict for updates
- if itip['sequence'] > event.get_sequence():
+ if itip['sequence'] > 0 and itip['sequence'] >= event.get_sequence():
conflict = False
if conflict: