remove participation parent author check
the check that the participation parent author is local is now done in the diaspora_federation gem
This commit is contained in:
parent
65f03b2d08
commit
e08306dab4
3 changed files with 6 additions and 16 deletions
|
|
@ -12,6 +12,7 @@ module Workers
|
|||
DiasporaFederation::Entity::InvalidEntityName,
|
||||
DiasporaFederation::Entity::UnknownEntity,
|
||||
DiasporaFederation::Entities::Relayable::SignatureVerificationFailed,
|
||||
DiasporaFederation::Entities::Participation::ParentNotLocal,
|
||||
DiasporaFederation::Federation::Receiver::InvalidSender,
|
||||
DiasporaFederation::Federation::Receiver::NotPublic,
|
||||
DiasporaFederation::Salmon::SenderKeyNotFound,
|
||||
|
|
|
|||
|
|
@ -65,9 +65,11 @@ module Diaspora
|
|||
def self.participation(entity)
|
||||
author = author_of(entity)
|
||||
ignore_existing_guid(Participation, entity.guid, author) do
|
||||
parent = Mappings.model_class_for(entity.parent_type).find_by(guid: entity.parent_guid)
|
||||
|
||||
Participation.create!(author: author, guid: entity.guid, target: parent) if parent.author.local?
|
||||
Participation.create!(
|
||||
author: author,
|
||||
guid: entity.guid,
|
||||
target: Mappings.model_class_for(entity.parent_type).find_by(guid: entity.parent_guid)
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -255,19 +255,6 @@ describe Diaspora::Federation::Receive do
|
|||
expect(participation.target).to eq(post)
|
||||
end
|
||||
|
||||
it "does not save the participation if the target is not local" do
|
||||
remote_post = FactoryGirl.create(:status_message, author: sender, public: true)
|
||||
remote_participation = FactoryGirl.build(
|
||||
:participation_entity,
|
||||
author: sender.diaspora_handle,
|
||||
parent_guid: remote_post.guid
|
||||
)
|
||||
|
||||
expect(Diaspora::Federation::Receive.perform(remote_participation)).to be_nil
|
||||
|
||||
expect(Participation.exists?(guid: remote_participation.guid)).to be_falsey
|
||||
end
|
||||
|
||||
it_behaves_like "it ignores existing object received twice", Participation do
|
||||
let(:entity) { participation_entity }
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue