Merge pull request #498 from kmycode/upstream-20240124

Upstream 20240124
This commit is contained in:
KMY(雪あすか) 2024-01-24 09:03:43 +09:00 committed by GitHub
commit 306b96f04c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
106 changed files with 1396 additions and 1071 deletions

View file

@ -44,7 +44,7 @@ class ActivityPub::FetchRemoteStatusService < BaseService
# If we fetched a status that already exists, then we need to treat the
# activity as an update rather than create
activity_json['type'] = 'Update' if equals_or_includes_any?(activity_json['type'], %w(Create)) && Status.where(uri: object_uri, account_id: actor.id).exists?
activity_json['type'] = 'Update' if equals_or_includes_any?(activity_json['type'], %w(Create)) && Status.exists?(uri: object_uri, account_id: actor.id)
with_redis do |redis|
discoveries = redis.incr("status_discovery_per_request:#{@request_id}")

View file

@ -19,7 +19,7 @@ class VoteService < BaseService
already_voted = true
with_redis_lock("vote:#{@poll.id}:#{@account.id}") do
already_voted = @poll.votes.where(account: @account).exists?
already_voted = @poll.votes.exists?(account: @account)
ApplicationRecord.transaction do
@choices.each do |choice|