1.1 --- a/imip_agent.py Tue Sep 23 19:51:14 2014 +0200
1.2 +++ b/imip_agent.py Tue Sep 23 20:35:51 2014 +0200
1.3 @@ -191,7 +191,10 @@
1.4 ("VERSION", {}, "2.0")
1.5 ]
1.6 imip_store.to_stream(out, calendar, "VCALENDAR", encoding)
1.7 - return MIMEText(out.getvalue(), "calendar", encoding)
1.8 + part = MIMEText(out.getvalue(), "calendar", encoding)
1.9 + part.set_param("method", method)
1.10 + return part
1.11 +
1.12 finally:
1.13 out.close()
1.14
1.15 @@ -256,7 +259,7 @@
1.16 # Obtain a message part for the objects.
1.17
1.18 if all_objects:
1.19 - all_parts.append(to_part(method, all_objects))
1.20 + all_parts.append(to_part(response_methods[method], all_objects))
1.21
1.22 return all_parts
1.23
1.24 @@ -425,7 +428,7 @@
1.25 attendee_attr["PARTSTAT"] = "DECLINED"
1.26
1.27 self.details["ATTENDEE"] = [(attendee, attendee_attr)]
1.28 - return get_structure_items(self.details)
1.29 + return [("VEVENT", {}, get_structure_items(self.details))]
1.30
1.31 class Freebusy(Handler):
1.32
1.33 @@ -553,6 +556,9 @@
1.34 "REQUEST" : lambda handler: handler.request,
1.35 }
1.36
1.37 +response_methods = {
1.38 + "REQUEST" : "REPLY",
1.39 + }
1.40
1.41 def main():
1.42