diff options
author | multiple creatures <dev@multiple-creature.party> | 2019-05-21 01:58:07 -0500 |
---|---|---|
committer | multiple creatures <dev@multiple-creature.party> | 2019-05-21 03:17:31 -0500 |
commit | d6f37c6ae01c57164a69c6b7e4934d844a0c2a3a (patch) | |
tree | d6fc393472fc7b3e056cb1a5a7c13c3bd1de77f6 /app/lib/activitypub/activity/announce.rb | |
parent | cbdadfb5fa8088edb4b0ec879faf58b0d8272664 (diff) |
handle importing posts from json dumps
Diffstat (limited to 'app/lib/activitypub/activity/announce.rb')
-rw-r--r-- | app/lib/activitypub/activity/announce.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/app/lib/activitypub/activity/announce.rb b/app/lib/activitypub/activity/announce.rb index 1aa6ee9ec..99807d963 100644 --- a/app/lib/activitypub/activity/announce.rb +++ b/app/lib/activitypub/activity/announce.rb @@ -2,7 +2,7 @@ class ActivityPub::Activity::Announce < ActivityPub::Activity def perform - return reject_payload! if delete_arrived_first?(@json['id']) || !related_to_local_activity? + return reject_payload! if !@options[:imported] && (delete_arrived_first?(@json['id']) || !related_to_local_activity?) original_status = status_from_object @@ -15,10 +15,11 @@ class ActivityPub::Activity::Announce < ActivityPub::Activity status = Status.create!( account: @account, reblog: original_status, - uri: @json['id'], + uri: @options[:imported] ? nil : @json['id'], created_at: @json['published'], override_timestamps: @options[:override_timestamps], - visibility: visibility_from_audience + visibility: visibility_from_audience, + imported: @options[:imported] == true ) distribute(status) |