From 17bf3363ac600b72755167f82e059feb4fbffa87 Mon Sep 17 00:00:00 2001 From: unarist Date: Tue, 19 Sep 2017 03:30:11 +0900 Subject: 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. --- app/lib/activitypub/activity/announce.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'app/lib') 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 -- cgit