about summary refs log tree commit diff
path: root/app/lib
diff options
context:
space:
mode:
authorunarist <m.unarist@gmail.com>2017-09-19 03:30:11 +0900
committerEugen Rochko <eugen@zeonfederated.com>2017-09-18 20:30:11 +0200
commit17bf3363ac600b72755167f82e059feb4fbffa87 (patch)
tree8e6d83f7a7d03faf70bd49820cf08d02fa88f97a /app/lib
parentdcf1139ebd65375fd130d71c2e664827d00e9d4f (diff)
Add published property to ActivityPub activity for reblogs (#5000)
Since reblogs are serialized as Announce activity, its published property can be used for the creation time of reblog.
Diffstat (limited to 'app/lib')
-rw-r--r--app/lib/activitypub/activity/announce.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/app/lib/activitypub/activity/announce.rb b/app/lib/activitypub/activity/announce.rb
index c4da405c7..556f91235 100644
--- a/app/lib/activitypub/activity/announce.rb
+++ b/app/lib/activitypub/activity/announce.rb
@@ -11,7 +11,12 @@ class ActivityPub::Activity::Announce < ActivityPub::Activity
 
     return status unless status.nil?
 
-    status = Status.create!(account: @account, reblog: original_status, uri: @json['id'])
+    status = Status.create!(
+      account: @account,
+      reblog: original_status,
+      uri: @json['id'],
+      created_at: @json['published'] || Time.now.utc
+    )
     distribute(status)
     status
   end