1.1 --- a/imip_manager.py Thu Feb 05 18:10:04 2015 +0100
1.2 +++ b/imip_manager.py Thu Feb 05 18:44:52 2015 +0100
1.3 @@ -164,24 +164,23 @@
1.4
1.5 # Action methods.
1.6
1.7 - def process_received_request(self, accept, update=False):
1.8 + def process_received_request(self, update=False):
1.9
1.10 """
1.11 - Process the current request for the given 'user', accepting any request
1.12 - when 'accept' is true, declining requests otherwise. Return whether any
1.13 + Process the current request for the given 'user'. Return whether any
1.14 action was taken.
1.15
1.16 If 'update' is given, the sequence number will be incremented in order
1.17 to override any previous response.
1.18 """
1.19
1.20 - # When accepting or declining, do so only on behalf of this user,
1.21 - # preserving any other attributes set as an attendee.
1.22 + # Reply only on behalf of this user.
1.23
1.24 for attendee, attendee_attr in self.obj.get_items("ATTENDEE"):
1.25
1.26 if attendee == self.user:
1.27 - attendee_attr["PARTSTAT"] = accept and "ACCEPTED" or "DECLINED"
1.28 + if attendee_attr.has_key("RSVP"):
1.29 + del attendee_attr["RSVP"]
1.30 if self.messenger and self.messenger.sender != get_address(attendee):
1.31 attendee_attr["SENT-BY"] = get_uri(self.messenger.sender)
1.32 self.obj["ATTENDEE"] = [(attendee, attendee_attr)]
1.33 @@ -485,21 +484,20 @@
1.34
1.35 # Process any action.
1.36
1.37 - accept = args.has_key("accept")
1.38 - decline = args.has_key("decline")
1.39 + reply = args.has_key("reply")
1.40 discard = args.has_key("discard")
1.41 invite = args.has_key("invite")
1.42 cancel = args.has_key("cancel")
1.43 save = args.has_key("save")
1.44 update = not queued and args.has_key("update")
1.45
1.46 - if accept or decline or invite or cancel:
1.47 + if reply or invite or cancel:
1.48
1.49 handler = ManagerHandler(obj, self.user, self.messenger)
1.50
1.51 # Process the object and remove it from the list of requests.
1.52
1.53 - if (accept or decline) and handler.process_received_request(accept, update) or \
1.54 + if reply and handler.process_received_request(update) or \
1.55 (invite or cancel) and handler.process_created_request(invite and "REQUEST" or "CANCEL", update):
1.56
1.57 self.remove_request(uid)
1.58 @@ -551,11 +549,7 @@
1.59
1.60 if is_attendee and not is_organiser:
1.61 partstat = attendee_attr.get("PARTSTAT")
1.62 - if partstat == "ACCEPTED":
1.63 - page.p("This request has been accepted.")
1.64 - elif partstat == "DECLINED":
1.65 - page.p("This request has been declined.")
1.66 - else:
1.67 + if not partstat:
1.68 page.p("This request has not yet been dealt with.")
1.69
1.70 if needs_update:
1.71 @@ -564,9 +558,7 @@
1.72 page.p("An action is required for this request:")
1.73
1.74 page.p()
1.75 - page.input(name="accept", type="submit", value="Accept")
1.76 - page.add(" ")
1.77 - page.input(name="decline", type="submit", value="Decline")
1.78 + page.input(name="reply", type="submit", value="Reply")
1.79 page.add(" ")
1.80 page.input(name="discard", type="submit", value="Discard")
1.81 page.p.close()