Notify a remote user when a non-contact user likes or comment her public post
This commit is contained in:
parent
6ac6dc1059
commit
dc02c5384b
1 changed files with 9 additions and 0 deletions
|
|
@ -61,5 +61,14 @@ class Postzord::Receiver::LocalBatch < Postzord::Receiver
|
||||||
@users.find_each do |user|
|
@users.find_each do |user|
|
||||||
Notification.notify(user, @object, @object.author)
|
Notification.notify(user, @object, @object.author)
|
||||||
end
|
end
|
||||||
|
if @object.respond_to?(:target)
|
||||||
|
additional_subscriber = @object.target.author.owner
|
||||||
|
elsif @object.respond_to?(:post)
|
||||||
|
additional_subscriber = @object.post.author.owner
|
||||||
|
end
|
||||||
|
|
||||||
|
Notification.notify(additional_subscriber, @object, @object.author) if additional_subscriber &&
|
||||||
|
additional_subscriber != @object.author.owner &&
|
||||||
|
!@users.exists?(additional_subscriber.id)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue