# If the boosted toot is embedded and it is a self-boost, handle it like a Create
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']))
if actor_id == @account.uri
return ActivityPub::Activity.factory({ 'type' => 'Create', 'actor' => actor_id, 'object' => @object }, @account).perform
end
end
- context 'self-boost of a previously unknown status with missing attributedTo' do
- let(:object_json) do
- {
- id: 'https://example.com/actor#bar',
- type: 'Note',
- content: 'Lorem ipsum',
- to: 'http://example.com/followers',
- }
- end
-
- it 'creates a reblog by sender of status' do
- expect(sender.reblogged?(sender.statuses.first)).to be true
- end
- end
-
context 'self-boost of a previously unknown status with correct attributedTo' do
let(:object_json) do
{
type: 'Note',
content: 'Lorem ipsum',
to: 'http://example.com/followers',
+ attributedTo: 'https://example.com/actor',
}
end
type: 'Note',
content: 'Lorem ipsum',
to: 'http://example.com/followers',
+ attributedTo: 'https://example.com/actor',
}
end
type: 'Note',
content: 'Lorem ipsum',
to: 'http://example.com/followers',
+ attributedTo: 'https://example.com/actor',
}
end