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
|
end
|
||||||
|
|
||||||
def scope_account_local_followers(account)
|
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
|
end
|
||||||
|
|
||||||
def scope_status_mentioned(status)
|
def scope_status_mentioned(status)
|
||||||
|
|
|
@ -6,20 +6,13 @@ class DeliveryEmojiReactionWorker
|
||||||
include Lockable
|
include Lockable
|
||||||
include AccountScope
|
include AccountScope
|
||||||
|
|
||||||
def perform(payload_json, status_id, my_account_id = nil)
|
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
|
|
||||||
|
|
||||||
status = Status.find(status_id.to_i)
|
status = Status.find(status_id.to_i)
|
||||||
|
|
||||||
if status.present?
|
if status.present?
|
||||||
scope_status(status).includes(:user).find_each do |account|
|
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}")
|
redis.publish("timeline:#{account.id}", payload_json) if !account.user&.setting_stop_emoji_reaction_streaming && redis.exists?("subscribed:timeline:#{account.id}")
|
||||||
end
|
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
|
end
|
||||||
|
|
||||||
true
|
true
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue