Class: Notifications::CommentOnPost

Inherits:
Notification show all
Includes:
Commented
Defined in:
app/models/notifications/comment_on_post.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Commented

#deleted_translation_key

Methods inherited from Notification

concatenate_or_create, create_notification, #email_the_user, for, #linked_object, #set_read_state

Methods included from Diaspora::Fields::Guid

included, #set_guid

Class Method Details

.notify(comment, _recipient_user_ids) ⇒ Object


15
16
17
18
19
20
21
22
23
# File 'app/models/notifications/comment_on_post.rb', line 15

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

Instance Method Details

#mail_jobObject


7
8
9
# File 'app/models/notifications/comment_on_post.rb', line 7

def mail_job
  Workers::Mail::CommentOnPost
end

11
12
13
# File 'app/models/notifications/comment_on_post.rb', line 11

def popup_translation_key
  "notifications.comment_on_post"
end