diaspora/app/models/notifications/started_sharing.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

20 lines
450 B
Ruby

module Notifications
class StartedSharing < Notification
def mail_job
Workers::Mail::StartedSharing
end
def popup_translation_key
"notifications.started_sharing"
end
def self.notify(contact, _recipient_user_ids)
sender = contact.person
create_notification(contact.user, sender, sender).try(:email_the_user, sender, sender)
end
def contact
recipient.contact_for(target)
end
end
end