# HG changeset patch # User Paul Boddie # Date 1389139624 -3600 # Node ID 6f716b078d0b15b48f66d0d5f46ae552c2984083 # Parent abadc41121d101d9b432e8d0333081976d3b1565 Propagate date information to the individual updates. diff -r abadc41121d1 -r 6f716b078d0b actions/PostMessage.py --- a/actions/PostMessage.py Wed Jan 08 01:05:11 2014 +0100 +++ b/actions/PostMessage.py Wed Jan 08 01:07:04 2014 +0100 @@ -33,13 +33,13 @@ # Handle a single part. if not is_collection(update): - all_successful = all_successful and self.handle_message_parts([update], update) + all_successful = all_successful and self.handle_message_parts(message, [update], update) # Or a collection of alternative representations for a single # update. else: - all_successful = all_successful and self.handle_message_parts(update.get_payload(), update) + all_successful = all_successful and self.handle_message_parts(message, update.get_payload(), update) # Default output. @@ -49,12 +49,12 @@ else: request.write("Some updates were unsuccessful.") - def handle_message_parts(self, parts, update): + def handle_message_parts(self, message, parts, update): """ - Handle the given message 'parts', using the original 'update' to - determine whether the content is to replace or update page content, or - whether it will be placed in a message store. + From the given 'message', handle the given 'parts', using the original + 'update' to determine whether the content is to replace or update page + content, or whether it will be placed in a message store. """ request = self.request @@ -78,6 +78,11 @@ update["Moin-User"] = request.user and request.user.valid and request.user.name or None + # Propagate time information using the unintuitive time functions. + + if message.date: + update["Date"] = message.date.as_RFC2822_datetime_string() + self.store.append(update.as_string()) # Update the page.