Fix emoji reaction notification
This commit is contained in:
parent
d3fe6ac7b2
commit
dba5620052
2 changed files with 2 additions and 9 deletions
|
@ -17,7 +17,7 @@ module AccountScope
|
|||
end
|
||||
|
||||
def scope_account_local_followers(account)
|
||||
account.followers_for_local_distribution.select(:id).reorder(nil)
|
||||
account.followers_for_local_distribution.or(Account.where(id: account.id)).select(:id).reorder(nil)
|
||||
end
|
||||
|
||||
def scope_status_mentioned(status)
|
||||
|
|
|
@ -6,20 +6,13 @@ class DeliveryEmojiReactionWorker
|
|||
include Lockable
|
||||
include AccountScope
|
||||
|
||||
def perform(payload_json, status_id, my_account_id = nil)
|
||||
redis.publish("timeline:#{my_account_id}", payload_json) if my_account_id.present? && !Account.find(my_account_id)&.user&.setting_stop_emoji_reaction_streaming
|
||||
|
||||
def perform(payload_json, status_id, _my_account_id = nil)
|
||||
status = Status.find(status_id.to_i)
|
||||
|
||||
if status.present?
|
||||
scope_status(status).includes(:user).find_each do |account|
|
||||
redis.publish("timeline:#{account.id}", payload_json) if !account.user&.setting_stop_emoji_reaction_streaming && redis.exists?("subscribed:timeline:#{account.id}")
|
||||
end
|
||||
|
||||
if [:public, :unlisted, :public_unlisted, :login].exclude?(status.visibility.to_sym) && status.account_id != my_account_id &&
|
||||
redis.exists?("subscribed:timeline:#{status.account_id}") && !status.account.user&.setting_stop_emoji_reaction_streaming
|
||||
redis.publish("timeline:#{status.account_id}", payload_json)
|
||||
end
|
||||
end
|
||||
|
||||
true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue