Merge branch 'main' into glitch-soc/merge-upstream

Conflicts:
- `CONTRIBUTING.md`:
  Not a real conflict, glitch-soc quotes the upstream file, which has been
  changed. Update the quote.
This commit is contained in:
Claire
2021-01-26 14:01:30 +01:00
26 changed files with 37 additions and 40 deletions

View File

@@ -175,7 +175,7 @@ class AccountSearchService < BaseService
end
def username_complete?
query.include?('@') && "@#{query}" =~ /\A#{Account::MENTION_RE}\Z/
query.include?('@') && "@#{query}".match?(/\A#{Account::MENTION_RE}\Z/)
end
def likely_acct?

View File

@@ -23,11 +23,8 @@ class ActivityPub::FetchFeaturedCollectionService < BaseService
def process_items(items)
status_ids = items.map { |item| value_or_id(item) }
.reject { |uri| ActivityPub::TagManager.instance.local_uri?(uri) }
.filter_map { |uri| ActivityPub::FetchRemoteStatusService.new.call(uri) }
.select { |status| status.account_id == @account.id }
.map(&:id)
.filter_map { |uri| ActivityPub::FetchRemoteStatusService.new.call(uri) unless ActivityPub::TagManager.instance.local_uri?(uri) }
.filter_map { |status| status.id if status.account_id == @account.id }
to_remove = []
to_add = status_ids

View File

@@ -47,11 +47,11 @@ class FetchLinkCardService < BaseService
Request.new(:get, @url).add_headers('Accept' => 'text/html', 'User-Agent' => Mastodon::Version.user_agent + ' Bot').perform do |res|
if res.code == 200 && res.mime_type == 'text/html'
@html = res.body_with_limit
@html_charset = res.charset
@html = res.body_with_limit
else
@html = nil
@html_charset = nil
@html = nil
end
end
end

View File

@@ -72,7 +72,7 @@ class SearchService < BaseService
end
def url_query?
@resolve && @query =~ /\Ahttps?:\/\//
@resolve && /\Ahttps?:\/\//.match?(@query)
end
def url_resource_results