Class: Notifications::Liked

Inherits:
Notification show all
Defined in:
app/models/notifications/liked.rb

Class Method Summary collapse

Instance Method Summary collapse

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(like, _recipient_user_ids) ⇒ Object


17
18
19
20
21
22
23
24
# File 'app/models/notifications/liked.rb', line 17

def self.notify(like, _recipient_user_ids)
  actor = like.author
  target_author = like.target.author

  return unless like.target_type == "Post" && target_author.local? && actor != target_author

  concatenate_or_create(target_author.owner, like.target, actor).email_the_user(like, actor)
end

Instance Method Details

#deleted_translation_keyObject


13
14
15
# File 'app/models/notifications/liked.rb', line 13

def deleted_translation_key
  "notifications.liked_post_deleted"
end

#mail_jobObject


5
6
7
# File 'app/models/notifications/liked.rb', line 5

def mail_job
  Workers::Mail::Liked
end

9
10
11
# File 'app/models/notifications/liked.rb', line 9

def popup_translation_key
  "notifications.liked"
end