Merge remote-tracking branch 'tootsuite/main' into custom/quote
# Conflicts: # app/javascript/mastodon/components/status.js # app/javascript/mastodon/features/status/components/detailed_status.js # app/serializers/rest/instance_serializer.rb
This commit is contained in:
@@ -225,8 +225,8 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
|
||||
emoji ||= CustomEmoji.new(domain: @account.domain, shortcode: shortcode, uri: uri)
|
||||
emoji.image_remote_url = image_url
|
||||
emoji.save
|
||||
rescue Seahorse::Client::NetworkingError
|
||||
nil
|
||||
rescue Seahorse::Client::NetworkingError => e
|
||||
Rails.logger.warn "Error storing emoji: #{e}"
|
||||
end
|
||||
|
||||
def process_attachments
|
||||
@@ -249,8 +249,8 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
|
||||
media_attachment.save
|
||||
rescue Mastodon::UnexpectedResponseError, HTTP::TimeoutError, HTTP::ConnectionError, OpenSSL::SSL::SSLError
|
||||
RedownloadMediaWorker.perform_in(rand(30..600).seconds, media_attachment.id)
|
||||
rescue Seahorse::Client::NetworkingError
|
||||
nil
|
||||
rescue Seahorse::Client::NetworkingError => e
|
||||
Rails.logger.warn "Error storing media attachment: #{e}"
|
||||
end
|
||||
end
|
||||
|
||||
@@ -448,10 +448,14 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
|
||||
end
|
||||
|
||||
def supported_blurhash?(blurhash)
|
||||
components = blurhash.blank? ? nil : Blurhash.components(blurhash)
|
||||
components = blurhash.blank? || !blurhash_valid_chars?(blurhash) ? nil : Blurhash.components(blurhash)
|
||||
components.present? && components.none? { |comp| comp > 5 }
|
||||
end
|
||||
|
||||
def blurhash_valid_chars?(blurhash)
|
||||
/^[\w#$%*+-.:;=?@\[\]^{|}~]+$/.match?(blurhash)
|
||||
end
|
||||
|
||||
def skip_download?
|
||||
return @skip_download if defined?(@skip_download)
|
||||
|
||||
|
Reference in New Issue
Block a user