diff --git a/daemon.py b/daemon.py index 288c06fb1..22edb37cd 100644 --- a/daemon.py +++ b/daemon.py @@ -19235,6 +19235,16 @@ class PubServer(BaseHTTPRequestHandler): edited_postid = edited_postid.split('?')[0] print('DEBUG: edited_postid ' + edited_postid) + # get the published date of an edited post + edited_published = None + if '?editpub=' in path: + edited_published = path.split('?editpub=')[1] + if '?' in edited_published: + edited_published = \ + edited_published.split('?')[0] + print('DEBUG: edited_published ' + + edited_published) + length = int(headers['Content-Length']) if length > self.server.max_post_length: print('POST size too large') @@ -19862,12 +19872,23 @@ class PubServer(BaseHTTPRequestHandler): print('DEBUG: posting DM edited_postid ' + str(edited_postid)) if edited_postid: + edited_updated = \ + message_json['object']['published'] + if edited_published: + message_json['published'] = \ + edited_published + message_json['object']['published'] = \ + edited_published message_json['id'] = \ edited_postid + '/activity' message_json['object']['id'] = \ edited_postid message_json['object']['url'] = \ edited_postid + message_json['updated'] = \ + edited_updated + message_json['object']['updated'] = \ + edited_updated message_json['type'] = 'Update' print('DEBUG: sending edited dm post ' + str(message_json)) diff --git a/webapp_create_post.py b/webapp_create_post.py index 0affde481..033067791 100644 --- a/webapp_create_post.py +++ b/webapp_create_post.py @@ -283,6 +283,7 @@ def html_new_post(edit_post_params: {}, """ # get the json if this is an edited post edited_post_json = None + edited_published = '' if edit_post_params: if edit_post_params.get('post_url'): edited_post_filename = \ @@ -300,6 +301,8 @@ def html_new_post(edit_post_params: {}, in_reply_to = edit_post_params['replyTo'] if edit_post_params['scope'] == 'dm': mentions = edited_post_json['object']['to'] + edited_published = \ + edited_post_json['object']['published'] # default subject line or content warning default_subject = '' @@ -961,7 +964,8 @@ def html_new_post(edit_post_params: {}, '
\n' + '?editid=' + edit_post_params['post_url'] + \ + '?editpub=' + edited_published + '">\n' else: new_post_form += \ '