@ -138,11 +138,13 @@ class ActivityPub::Activity
def status_from_object
def status_from_object
# If the status is already known, return it
# If the status is already known, return it
status = status_from_uri ( object_uri )
status = status_from_uri ( object_uri )
return status unless status . nil?
return status unless status . nil?
# If the boosted toot is embedded and it is a self-boost, handle it like a Create
# If the boosted toot is embedded and it is a self-boost, handle it like a Create
unless unsupported_object_type?
unless unsupported_object_type?
actor_id = value_or_id ( first_of_value ( @object [ 'attributedTo' ] ) ) || @account . uri
actor_id = value_or_id ( first_of_value ( @object [ 'attributedTo' ] ) ) || @account . uri
if actor_id == @account . uri
if actor_id == @account . uri
return ActivityPub :: Activity . factory ( { 'type' = > 'Create' , 'actor' = > actor_id , 'object' = > @object } , @account ) . perform
return ActivityPub :: Activity . factory ( { 'type' = > 'Create' , 'actor' = > actor_id , 'object' = > @object } , @account ) . perform
end
end
@ -166,4 +168,16 @@ class ActivityPub::Activity
ensure
ensure
redis . del ( key )
redis . del ( key )
end
end
def fetch?
! @options [ :delivery ]
end
def followed_by_local_accounts?
@account . passive_relationships . exists?
end
def requested_through_relay?
@options [ :relayed_through_account ] && Relay . find_by ( inbox_url : @options [ :relayed_through_account ] . inbox_url ) & . enabled?
end
end
end