# HG changeset patch # User Paul Boddie # Date 1391196602 -3600 # Node ID 8845f10af6c68e3ec399f9d9b1127b08f0342d8b # Parent 89736cca0a7ab448b5d7bbd3b32207e7c2e39d22 Retain the original message as an instance attribute in order to propagate information to processed updates. diff -r 89736cca0a7a -r 8845f10af6c6 MoinMessageSupport.py --- a/MoinMessageSupport.py Fri Jan 31 19:56:50 2014 +0100 +++ b/MoinMessageSupport.py Fri Jan 31 20:30:02 2014 +0100 @@ -44,6 +44,7 @@ self.pagename = pagename self.request = request self.page = Page(request, pagename) + self.message = None self.new_user = None def init_store(self): @@ -135,6 +136,9 @@ # NOTE: An action should be able to process stored messages, # NOTE: by invoking code that is also used asynchronously. + # Remember the original message for later processing. + + self.message = message self.new_user = new_user # Handle the parsed message. diff -r 89736cca0a7a -r 8845f10af6c6 actions/PostMessage.py --- a/actions/PostMessage.py Fri Jan 31 19:56:50 2014 +0100 +++ b/actions/PostMessage.py Fri Jan 31 20:30:02 2014 +0100 @@ -85,6 +85,11 @@ if to_store(update): + # Add any recipient from the original message. + + if self.message.has_key("To") and not update.has_key("To"): + update["To"] = self.message["To"] + # Add any authenticated user. # Note that where messages are signed by the real author, encrypted, # and then signed for sending, the authenticated user here is not