Autofix Rubocop remaining Layout rules (#23679)
This commit is contained in:
@@ -50,6 +50,7 @@ class ActivityPub::FetchRemoteActorService < BaseService
|
||||
|
||||
if @username.casecmp(confirmed_username).zero? && @domain.casecmp(confirmed_domain).zero?
|
||||
raise Error, "Webfinger response for #{@username}@#{@domain} does not loop back to #{@uri}" if webfinger.link('self', 'href') != @uri
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
|
@@ -56,6 +56,7 @@ class ActivityPub::FetchRemoteStatusService < BaseService
|
||||
|
||||
def trustworthy_attribution?(uri, attributed_to)
|
||||
return false if uri.nil? || attributed_to.nil?
|
||||
|
||||
Addressable::URI.parse(uri).normalized_host.casecmp(Addressable::URI.parse(attributed_to).normalized_host).zero?
|
||||
end
|
||||
|
||||
|
@@ -36,6 +36,7 @@ class ActivityPub::FetchRepliesService < BaseService
|
||||
return collection_or_uri if collection_or_uri.is_a?(Hash)
|
||||
return unless @allow_synchronous_requests
|
||||
return if invalid_origin?(collection_or_uri)
|
||||
|
||||
fetch_resource_without_id_validation(collection_or_uri, nil, true)
|
||||
end
|
||||
|
||||
|
@@ -226,6 +226,7 @@ class ActivityPub::ProcessAccountService < BaseService
|
||||
|
||||
def property_values
|
||||
return unless @json['attachment'].is_a?(Array)
|
||||
|
||||
as_array(@json['attachment']).select { |attachment| attachment['type'] == 'PropertyValue' }.map { |attachment| attachment.slice('name', 'value') }
|
||||
end
|
||||
|
||||
@@ -289,6 +290,7 @@ class ActivityPub::ProcessAccountService < BaseService
|
||||
|
||||
def domain_block
|
||||
return @domain_block if defined?(@domain_block)
|
||||
|
||||
@domain_block = DomainBlock.rule_for(@domain)
|
||||
end
|
||||
|
||||
|
@@ -40,6 +40,7 @@ class FavouriteService < BaseService
|
||||
def bump_potential_friendship(account, status)
|
||||
ActivityTracker.increment('activity:interactions')
|
||||
return if account.following?(status.account_id)
|
||||
|
||||
PotentialFriendshipTracker.record(account.id, status.account_id, :favourite)
|
||||
end
|
||||
|
||||
|
@@ -9,10 +9,10 @@ class Keys::ClaimService < BaseService
|
||||
|
||||
def initialize(account, device_id, key_attributes = {})
|
||||
super(
|
||||
account: account,
|
||||
account: account,
|
||||
device_id: device_id,
|
||||
key_id: key_attributes[:key_id],
|
||||
key: key_attributes[:key],
|
||||
key_id: key_attributes[:key_id],
|
||||
key: key_attributes[:key],
|
||||
signature: key_attributes[:signature],
|
||||
)
|
||||
end
|
||||
|
@@ -23,9 +23,9 @@ class Keys::QueryService < BaseService
|
||||
|
||||
def initialize(attributes = {})
|
||||
super(
|
||||
device_id: attributes[:device_id],
|
||||
name: attributes[:name],
|
||||
identity_key: attributes[:identity_key],
|
||||
device_id: attributes[:device_id],
|
||||
name: attributes[:name],
|
||||
identity_key: attributes[:identity_key],
|
||||
fingerprint_key: attributes[:fingerprint_key],
|
||||
)
|
||||
@claim_url = attributes[:claim_url]
|
||||
|
@@ -31,6 +31,7 @@ class NotifyService < BaseService
|
||||
|
||||
def following_sender?
|
||||
return @following_sender if defined?(@following_sender)
|
||||
|
||||
@following_sender = @recipient.following?(@notification.from_account) || @recipient.requested?(@notification.from_account)
|
||||
end
|
||||
|
||||
|
@@ -86,6 +86,7 @@ class PostStatusService < BaseService
|
||||
|
||||
def safeguard_mentions!(status)
|
||||
return if @options[:allowed_mentions].nil?
|
||||
|
||||
expected_account_ids = @options[:allowed_mentions].map(&:to_i)
|
||||
|
||||
unexpected_accounts = status.mentions.map(&:account).to_a.reject { |mentioned_account| expected_account_ids.include?(mentioned_account.id) }
|
||||
@@ -175,8 +176,10 @@ class PostStatusService < BaseService
|
||||
|
||||
def bump_potential_friendship!
|
||||
return if !@status.reply? || @account.id == @status.in_reply_to_account_id
|
||||
|
||||
ActivityTracker.increment('activity:interactions')
|
||||
return if @account.following?(@status.in_reply_to_account_id)
|
||||
|
||||
PotentialFriendshipTracker.record(@account.id, @status.in_reply_to_account_id, :reply)
|
||||
end
|
||||
|
||||
|
@@ -44,11 +44,13 @@ class VoteService < BaseService
|
||||
|
||||
def distribute_poll!
|
||||
return if @poll.hide_totals?
|
||||
|
||||
ActivityPub::DistributePollUpdateWorker.perform_in(3.minutes, @poll.status.id)
|
||||
end
|
||||
|
||||
def queue_final_poll_check!
|
||||
return unless @poll.expires?
|
||||
|
||||
PollExpirationNotifyWorker.perform_at(@poll.expires_at + 5.minutes, @poll.id)
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user