diaspora/app/models/notifications/reshared.rb
Benjamin Neff 0d338b6f79 don't create notifications if the notification-actor is ignored
Also move "shareable hidden"-logic to AlsoCommented, because it is the
only one that needs it. And write some specs for mentioned and started
sharing notifications.

Fixes #6294
2016-08-14 17:03:49 +02:00

22 lines
547 B
Ruby

module Notifications
class Reshared < Notification
def mail_job
Workers::Mail::Reshared
end
def popup_translation_key
"notifications.reshared"
end
def deleted_translation_key
"notifications.reshared_post_deleted"
end
def self.notify(reshare, _recipient_user_ids)
return unless reshare.root.present? && reshare.root.author.local?
actor = reshare.author
concatenate_or_create(reshare.root.author.owner, reshare.root, actor).try(:email_the_user, reshare, actor)
end
end
end