Add emoji reaction notification support
This commit is contained in:
parent
dfe1332be6
commit
de951a0ef9
11 changed files with 100 additions and 23 deletions
|
@ -7,14 +7,29 @@ class FeedAnyJsonWorker
|
|||
include AccountLimitable
|
||||
|
||||
def perform(payload_json, status_id, my_account_id = nil)
|
||||
p '========================================= DEBUG AAA'
|
||||
redis.publish("timeline:#{my_account_id}", payload_json) if my_account_id.present?
|
||||
p '========================================= DEBUG AA'
|
||||
p status_id
|
||||
p status_id.to_i
|
||||
|
||||
status = Status.find(status_id.to_i)
|
||||
p '========================================= DEBUG AAAAAAAA'
|
||||
p status.present?
|
||||
|
||||
if status.present?
|
||||
scope_status(status).find_each do |account_id|
|
||||
p account_id if redis.exists?("subscribed:timeline:#{account_id}")
|
||||
redis.publish("timeline:#{account_id}", payload_json) if redis.exists?("subscribed:timeline:#{account_id}")
|
||||
p '========================================= DEBUG A'
|
||||
p scope_status(status)
|
||||
p '========================================= DEBUG C'
|
||||
scope_status(status).find_each do |account|
|
||||
p '========================================= DEBUG D'
|
||||
p redis.exists?("subscribed:timeline:#{account.id}")
|
||||
redis.publish("timeline:#{account.id}", payload_json) if redis.exists?("subscribed:timeline:#{account.id}")
|
||||
end
|
||||
|
||||
if status.visibility.to_sym != :public && status.visibility.to_sym != :unlisted && status.account_id != my_account_id &&
|
||||
redis.exists?("subscribed:timeline:#{status.account_id}")
|
||||
redis.publish("timeline:#{status.account_id}", payload_json)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ class UnEmojiReactWorker
|
|||
.find { |reaction| domain == '' ? reaction.custom_emoji.nil? : reaction.custom_emoji&.domain == domain }
|
||||
end
|
||||
|
||||
UnEmojiReactService.new.call(Account.find(account_id), Status.find(status_id), emoji_reaction)
|
||||
UnEmojiReactService.new.call(account_id.to_i, status_id.to_i, emoji_reaction)
|
||||
rescue ActiveRecord::RecordNotFound
|
||||
true
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue