diaspora/app/models/notifications/comment_on_post.rb
2016-11-28 15:56:56 +02:00

23 lines
651 B
Ruby

module Notifications
class CommentOnPost < Notification
include Notifications::Commented
def mail_job
Workers::Mail::CommentOnPost
end
def popup_translation_key
"notifications.comment_on_post"
end
def self.notify(comment, _recipient_user_ids)
actor = comment.author
commentable_author = comment.commentable.author
return unless commentable_author.local? && actor != commentable_author
return if mention_notification_exists?(comment, commentable_author)
concatenate_or_create(commentable_author.owner, comment.commentable, actor).email_the_user(comment, actor)
end
end
end