# HG changeset patch # User Paul Boddie # Date 1411497351 -7200 # Node ID 4018cd604f93cca203e4d01a342ff02f83daa7f0 # Parent 4f2c6bcd8c3905427ed08ac12232dccf918fa9f7 Fixed reply methods in calendar content and content-type parameters. Fixed the absence of VEVENT sections around event data in replies. diff -r 4f2c6bcd8c39 -r 4018cd604f93 imip_agent.py --- a/imip_agent.py Tue Sep 23 19:51:14 2014 +0200 +++ b/imip_agent.py Tue Sep 23 20:35:51 2014 +0200 @@ -191,7 +191,10 @@ ("VERSION", {}, "2.0") ] imip_store.to_stream(out, calendar, "VCALENDAR", encoding) - return MIMEText(out.getvalue(), "calendar", encoding) + part = MIMEText(out.getvalue(), "calendar", encoding) + part.set_param("method", method) + return part + finally: out.close() @@ -256,7 +259,7 @@ # Obtain a message part for the objects. if all_objects: - all_parts.append(to_part(method, all_objects)) + all_parts.append(to_part(response_methods[method], all_objects)) return all_parts @@ -425,7 +428,7 @@ attendee_attr["PARTSTAT"] = "DECLINED" self.details["ATTENDEE"] = [(attendee, attendee_attr)] - return get_structure_items(self.details) + return [("VEVENT", {}, get_structure_items(self.details))] class Freebusy(Handler): @@ -553,6 +556,9 @@ "REQUEST" : lambda handler: handler.request, } +response_methods = { + "REQUEST" : "REPLY", + } def main():