diff --git a/Changelog.md b/Changelog.md index 9be9daa03..fb7e4d72e 100644 --- a/Changelog.md +++ b/Changelog.md @@ -8,6 +8,7 @@ * Fix notifications for interactions by non-contacts [#6498](https://github.com/diaspora/diaspora/pull/6498) * Fix issue where the publisher was broken on profile pages [#6503](https://github.com/diaspora/diaspora/pull/6503) * Prevent participations being created for invalid interactions [#6552](https://github.com/diaspora/diaspora/pull/6552) +* Improve federation for reshare related interactions [#6481](https://github.com/diaspora/diaspora/pull/6481) ## Features diff --git a/app/models/reshare.rb b/app/models/reshare.rb index 93803af1d..1781595e9 100644 --- a/app/models/reshare.rb +++ b/app/models/reshare.rb @@ -56,6 +56,7 @@ class Reshare < Post def receive(recipient, sender) local_reshare = Reshare.where(:guid => self.guid).first if local_reshare && local_reshare.root.author_id == recipient.person.id + recipient.participate! self return unless recipient.has_contact_for?(sender) end super(recipient, sender) diff --git a/spec/models/reshare_spec.rb b/spec/models/reshare_spec.rb index e235c4066..6a5f2cd45 100644 --- a/spec/models/reshare_spec.rb +++ b/spec/models/reshare_spec.rb @@ -50,7 +50,8 @@ describe Reshare, :type => :model do receive_reshare expect(@root.resharers).to include(@reshare.author) end - it 'does not error if the root author has a contact for the resharer' do + + it "does not error if the root author has a contact for the resharer" do bob.share_with @reshare.author, bob.aspects.first expect { Timeout.timeout(5) do @@ -58,6 +59,12 @@ describe Reshare, :type => :model do end }.not_to raise_error end + + it "participates root author in the reshare" do + receive_reshare + participations = Participation.where(target_id: @reshare.id, author_id: @root.author_id) + expect(participations.count).to eq(1) + end end describe '#nsfw' do