Add participation to root.author on receiving reshare
When author of the root post receives a reshare to it, no participation is added to the root author on the reshare. This causes any comments on the reshare on remote pods not to be sent to the author. Adding a participation should subscribe to the reshare and thus bring added comments back to the author. closes #6481
This commit is contained in:
parent
66925918b1
commit
9a35a0d8dd
3 changed files with 10 additions and 1 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue