1.1 --- a/actions/PostMessage.py Wed Jan 08 01:05:11 2014 +0100
1.2 +++ b/actions/PostMessage.py Wed Jan 08 01:07:04 2014 +0100
1.3 @@ -33,13 +33,13 @@
1.4 # Handle a single part.
1.5
1.6 if not is_collection(update):
1.7 - all_successful = all_successful and self.handle_message_parts([update], update)
1.8 + all_successful = all_successful and self.handle_message_parts(message, [update], update)
1.9
1.10 # Or a collection of alternative representations for a single
1.11 # update.
1.12
1.13 else:
1.14 - all_successful = all_successful and self.handle_message_parts(update.get_payload(), update)
1.15 + all_successful = all_successful and self.handle_message_parts(message, update.get_payload(), update)
1.16
1.17 # Default output.
1.18
1.19 @@ -49,12 +49,12 @@
1.20 else:
1.21 request.write("Some updates were unsuccessful.")
1.22
1.23 - def handle_message_parts(self, parts, update):
1.24 + def handle_message_parts(self, message, parts, update):
1.25
1.26 """
1.27 - Handle the given message 'parts', using the original 'update' to
1.28 - determine whether the content is to replace or update page content, or
1.29 - whether it will be placed in a message store.
1.30 + From the given 'message', handle the given 'parts', using the original
1.31 + 'update' to determine whether the content is to replace or update page
1.32 + content, or whether it will be placed in a message store.
1.33 """
1.34
1.35 request = self.request
1.36 @@ -78,6 +78,11 @@
1.37
1.38 update["Moin-User"] = request.user and request.user.valid and request.user.name or None
1.39
1.40 + # Propagate time information using the unintuitive time functions.
1.41 +
1.42 + if message.date:
1.43 + update["Date"] = message.date.as_RFC2822_datetime_string()
1.44 +
1.45 self.store.append(update.as_string())
1.46
1.47 # Update the page.