1.1 --- a/imiptools/content.py Mon Feb 02 17:38:01 2015 +0100
1.2 +++ b/imiptools/content.py Mon Feb 02 18:05:31 2015 +0100
1.3 @@ -153,7 +153,7 @@
1.4 # Ignore the part if not a calendar object.
1.5
1.6 if not itip:
1.7 - return []
1.8 + return
1.9
1.10 # Require consistency between declared and employed methods.
1.11
1.12 @@ -176,18 +176,7 @@
1.13 # Dispatch to a handler and obtain any response.
1.14
1.15 handler.set_object(Object({name : item}))
1.16 - results = methods[method](handler)()
1.17 -
1.18 - # Aggregate responses for a single message.
1.19 -
1.20 - if results:
1.21 - for result in results:
1.22 - outgoing_recipients, part = result
1.23 - all_results.append((outgoing_recipients, part))
1.24 -
1.25 - return all_results
1.26 -
1.27 - return []
1.28 + methods[method](handler)()
1.29
1.30 # References to the Web interface.
1.31
1.32 @@ -213,6 +202,9 @@
1.33 self.recipient = recipient and get_address(recipient)
1.34 self.messenger = messenger
1.35
1.36 + self.results = []
1.37 + self.outgoing_methods = set()
1.38 +
1.39 self.obj = None
1.40 self.uid = None
1.41 self.sequence = None
1.42 @@ -242,7 +234,26 @@
1.43 "message, you may view the details here:\n\n%s" %
1.44 get_object_url(self.uid))
1.45
1.46 - return [(None, MIMEText("\n".join(texts)))]
1.47 + return self.add_result(None, None, MIMEText("\n".join(texts)))
1.48 +
1.49 + # Result registration.
1.50 +
1.51 + def add_result(self, method, outgoing_recipients, part):
1.52 +
1.53 + """
1.54 + Record a result having the given 'method', 'outgoing_recipients' and
1.55 + message part.
1.56 + """
1.57 +
1.58 + if outgoing_recipients:
1.59 + self.outgoing_methods.add(method)
1.60 + self.results.append((outgoing_recipients, part))
1.61 +
1.62 + def get_results(self):
1.63 + return self.results
1.64 +
1.65 + def get_outgoing_methods(self):
1.66 + return self.outgoing_methods
1.67
1.68 # Access to calendar structures and other data.
1.69