mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 09:42:02 +08:00
FEATURE: New DiscourseEvent trigger for likes (#12374)
This commit is contained in:
parent
9aa510f609
commit
9737ce8c5f
|
@ -265,8 +265,13 @@ private
|
|||
end
|
||||
end
|
||||
|
||||
if post_action && PostActionType.notify_flag_type_ids.include?(@post_action_type_id)
|
||||
DiscourseEvent.trigger(:flag_created, post_action)
|
||||
if post_action
|
||||
case @post_action_type_id
|
||||
when *PostActionType.notify_flag_type_ids
|
||||
DiscourseEvent.trigger(:flag_created, post_action)
|
||||
when PostActionType.types[:like]
|
||||
DiscourseEvent.trigger(:like_created, post_action)
|
||||
end
|
||||
end
|
||||
|
||||
GivenDailyLike.increment_for(@created_by.id) if @post_action_type_id == PostActionType.types[:like]
|
||||
|
|
Loading…
Reference in New Issue
Block a user