1
0
Fork 0
forked from gitea/nas

Hide blocking domains/suspended/silenced emoji reactions and streaming

This commit is contained in:
KMY 2023-09-12 13:54:24 +09:00
parent cd252a6062
commit 477d427f1d
8 changed files with 28 additions and 10 deletions

View file

@ -6,6 +6,8 @@ class StatusCacheHydrator
end
def hydrate(account_id)
account = Account.find(account_id)
# The cache of the serialized hash is generated by the fan-out-on-write service
payload = Rails.cache.fetch("fan-out/#{@status.id}") { InlineRenderer.render(@status, nil, :status) }
@ -33,6 +35,7 @@ class StatusCacheHydrator
payload[:reblog][:bookmarked] = Bookmark.where(account_id: account_id, status_id: @status.reblog_of_id).exists?
payload[:reblog][:pinned] = StatusPin.where(account_id: account_id, status_id: @status.reblog_of_id).exists? if @status.reblog.account_id == account_id
payload[:reblog][:filtered] = payload[:filtered]
payload[:reblog][:emoji_reactions] = @status.emoji_reactions_grouped_by_name(account)
if payload[:reblog][:poll]
if @status.reblog.account_id == account_id
@ -56,6 +59,7 @@ class StatusCacheHydrator
payload[:filtered] = CustomFilter
.apply_cached_filters(CustomFilter.cached_filters_for(account_id), @status, following?(account_id))
.map { |filter| serialized_filter(filter) }
payload[:emoji_reactions] = @status.emoji_reactions_grouped_by_name(account)
if payload[:poll]
payload[:poll][:voted] = @status.account_id == account_id