Alternative handling of private self-boosts (#9998)

* When self-boosting, embed original toot into Announce serialization

* Process unknown self-boosts from Announce object if it is more than an URI

* Add some self-boost specs

* Only serialize private toots in self-Announces
This commit is contained in:
ThibG 2019-02-13 18:36:23 +01:00 committed by Eugen Rochko
parent 169b9d4428
commit 6a5307a573
5 changed files with 86 additions and 26 deletions

View file

@ -2,9 +2,7 @@
class ActivityPub::Activity::Announce < ActivityPub::Activity
def perform
original_status = status_from_uri(object_uri)
original_status ||= fetch_remote_original_status
original_status = status_from_object
return if original_status.nil? || delete_arrived_first?(@json['id']) || !announceable?(original_status)
status = Status.find_by(account: @account, reblog: original_status)