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

Conflicts:
- app/controllers/settings/preferences_controller.rb
- app/lib/user_settings_decorator.rb
- app/models/user.rb
- config/locales/simple_form.en.yml
This commit is contained in:
Thibaut Girka
2019-06-26 22:54:09 +02:00
24 changed files with 309 additions and 148 deletions

View File

@@ -5,7 +5,7 @@ class ActivityPub::Activity
include Redisable
SUPPORTED_TYPES = %w(Note Question).freeze
CONVERTED_TYPES = %w(Image Video Article Page).freeze
CONVERTED_TYPES = %w(Image Audio Video Article Page).freeze
def initialize(json, account, **options)
@json = json

View File

@@ -221,7 +221,8 @@ class FeedManager
status = status.reblog if status.reblog?
!combined_regex.match(Formatter.instance.plaintext(status)).nil? ||
(status.spoiler_text.present? && !combined_regex.match(status.spoiler_text).nil?)
(status.spoiler_text.present? && !combined_regex.match(status.spoiler_text).nil?) ||
(status.preloadable_poll && !combined_regex.match(status.preloadable_poll.options.join("\n\n")).nil?)
end
# Adds a status to an account's feed, returning true if a status was

View File

@@ -38,6 +38,7 @@ class UserSettingsDecorator
user.settings['show_application'] = show_application_preference if change?('setting_show_application')
user.settings['advanced_layout'] = advanced_layout_preference if change?('setting_advanced_layout')
user.settings['default_content_type']= default_content_type_preference if change?('setting_default_content_type')
user.settings['use_blurhash'] = use_blurhash_preference if change?('setting_use_blurhash')
end
def merged_notification_emails
@@ -132,6 +133,10 @@ class UserSettingsDecorator
settings['setting_default_content_type']
end
def use_blurhash_preference
boolean_cast_setting 'setting_use_blurhash'
end
def boolean_cast_setting(key)
ActiveModel::Type::Boolean.new.cast(settings[key])
end