Fix test
This commit is contained in:
parent
dba5f3b93f
commit
ebc6c9d6fb
1 changed files with 5 additions and 5 deletions
|
@ -26,9 +26,9 @@ class StatusCacheHydrator
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def hydrate_non_reblog_payload(empty_payload, account_id, _account)
|
def hydrate_non_reblog_payload(empty_payload, account_id, account)
|
||||||
empty_payload.tap do |payload|
|
empty_payload.tap do |payload|
|
||||||
fill_status_payload(payload, @status, account_id)
|
fill_status_payload(payload, @status, account_id, account)
|
||||||
|
|
||||||
if payload[:poll]
|
if payload[:poll]
|
||||||
payload[:poll][:voted] = @status.account_id == account_id
|
payload[:poll][:voted] = @status.account_id == account_id
|
||||||
|
@ -37,7 +37,7 @@ class StatusCacheHydrator
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def hydrate_reblog_payload(empty_payload, account_id, _account)
|
def hydrate_reblog_payload(empty_payload, account_id, account)
|
||||||
empty_payload.tap do |payload|
|
empty_payload.tap do |payload|
|
||||||
payload[:muted] = false
|
payload[:muted] = false
|
||||||
payload[:bookmarked] = false
|
payload[:bookmarked] = false
|
||||||
|
@ -47,7 +47,7 @@ class StatusCacheHydrator
|
||||||
# used to create the status, we need to hydrate it here too
|
# used to create the status, we need to hydrate it here too
|
||||||
payload[:reblog][:application] = payload_reblog_application if payload[:reblog][:application].nil? && @status.reblog.account_id == account_id
|
payload[:reblog][:application] = payload_reblog_application if payload[:reblog][:application].nil? && @status.reblog.account_id == account_id
|
||||||
|
|
||||||
fill_status_payload(payload[:reblog], @status.reblog, account_id)
|
fill_status_payload(payload[:reblog], @status.reblog, account_id, account)
|
||||||
|
|
||||||
if payload[:reblog][:poll]
|
if payload[:reblog][:poll]
|
||||||
if @status.reblog.account_id == account_id
|
if @status.reblog.account_id == account_id
|
||||||
|
@ -66,7 +66,7 @@ class StatusCacheHydrator
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def fill_status_payload(payload, status, account_id)
|
def fill_status_payload(payload, status, account_id, account)
|
||||||
payload[:favourited] = Favourite.exists?(account_id: account_id, status_id: status.id)
|
payload[:favourited] = Favourite.exists?(account_id: account_id, status_id: status.id)
|
||||||
payload[:reblogged] = Status.exists?(account_id: account_id, reblog_of_id: status.id)
|
payload[:reblogged] = Status.exists?(account_id: account_id, reblog_of_id: status.id)
|
||||||
payload[:muted] = ConversationMute.exists?(account_id: account_id, conversation_id: status.conversation_id)
|
payload[:muted] = ConversationMute.exists?(account_id: account_id, conversation_id: status.conversation_id)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue