]> cat aescling's git repositories - mastodon.git/commitdiff
Merge branch 'master' into glitch-soc/merge-upstream
authorThibaut Girka <thib@sitedethib.com>
Wed, 26 Jun 2019 20:54:09 +0000 (22:54 +0200)
committerThibaut Girka <thib@sitedethib.com>
Wed, 26 Jun 2019 21:19:22 +0000 (23:19 +0200)
Conflicts:
- app/controllers/settings/preferences_controller.rb
- app/lib/user_settings_decorator.rb
- app/models/user.rb
- config/locales/simple_form.en.yml

16 files changed:
1  2 
Gemfile
Gemfile.lock
app/controllers/application_controller.rb
app/controllers/settings/preferences_controller.rb
app/javascript/mastodon/features/compose/components/compose_form.js
app/javascript/mastodon/initial_state.js
app/lib/feed_manager.rb
app/lib/user_settings_decorator.rb
app/models/user.rb
app/serializers/initial_state_serializer.rb
app/views/settings/preferences/appearance/show.html.haml
config/locales/simple_form.en.yml
config/settings.yml
package.json
spec/lib/feed_manager_spec.rb
yarn.lock

diff --cc Gemfile
Simple merge
diff --cc Gemfile.lock
Simple merge
index 333082f68de5fba7cab95f5c8c281478e0ad9f94,bd8000db0fdf43a8d52434ad2ba16e9d88cfa17a..cef41255483a2efd7b7192fc3c5d474670635031
@@@ -165,17 -97,14 +167,19 @@@ class ApplicationController < ActionCon
    end
  
    def current_session
-     @current_session ||= SessionActivation.find_by(session_id: cookies.signed['_session_id'])
+     return @current_session if defined?(@current_session)
+     @current_session = SessionActivation.find_by(session_id: cookies.signed['_session_id']) if cookies.signed['_session_id'].present?
    end
  
 -  def current_theme
 -    return Setting.theme unless Themes.instance.names.include? current_user&.setting_theme
 -    current_user.setting_theme
 +  def current_flavour
 +    return Setting.flavour unless Themes.instance.flavours.include? current_user&.setting_flavour
 +    current_user.setting_flavour
 +  end
 +
 +  def current_skin
 +    return Setting.skin unless Themes.instance.skins_for(current_flavour).include? current_user&.setting_skin
 +    current_user.setting_skin
    end
  
    def cache_collection(raw, klass)
index 5103cc50e350010213c1625beed271f803646364,0a5c14cca7feb08f6472338865878be08ac2866e..451742d41282f49f9e355ef0d29be848b65fea93
@@@ -51,7 -54,7 +51,8 @@@ class Settings::PreferencesController 
        :setting_aggregate_reblogs,
        :setting_show_application,
        :setting_advanced_layout,
 +      :setting_default_content_type,
+       :setting_use_blurhash,
        notification_emails: %i(follow follow_request reblog favourite mention digest report pending_account),
        interactions: %i(must_be_follower must_be_following must_be_following_dm)
      )
Simple merge
index a95d09c5cbf054b735a69b47af36a6a6185b5ca3,aaf95cc198ba10d0789668a4444b75c436b26b4c..ac35fd00548ef1377abea2a0aa8ab39c089f697b
@@@ -37,7 -34,7 +37,8 @@@ class UserSettingsDecorato
      user.settings['aggregate_reblogs']   = aggregate_reblogs_preference if change?('setting_aggregate_reblogs')
      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
      boolean_cast_setting 'setting_advanced_layout'
    end
  
 +  def default_content_type_preference
 +    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
index f6936cb9da565e079e5aad21fb2d3375c563f5cb,3a4b415dd6060797d1d90405bbd27761eae494d6..9bc3dd6081bf8571fd2cf88d683b519f414401bd
@@@ -103,10 -103,10 +103,10 @@@ class User < ApplicationRecor
  
    has_many :session_activations, dependent: :destroy
  
 -  delegate :auto_play_gif, :default_sensitive, :unfollow_modal, :boost_modal, :delete_modal,
 -           :reduce_motion, :system_font_ui, :noindex, :theme, :display_media, :hide_network,
 +  delegate :auto_play_gif, :default_sensitive, :unfollow_modal, :boost_modal, :favourite_modal, :delete_modal,
 +           :reduce_motion, :system_font_ui, :noindex, :flavour, :skin, :display_media, :hide_network, :hide_followers_count,
             :expand_spoilers, :default_language, :aggregate_reblogs, :show_application,
-            :advanced_layout, :default_content_type, to: :settings, prefix: :setting, allow_nil: false
 -           :advanced_layout, :use_blurhash, to: :settings, prefix: :setting, allow_nil: false
++           :advanced_layout, :default_content_type, :use_blurhash, to: :settings, prefix: :setting, allow_nil: false
  
    attr_reader :invite_code
    attr_writer :external
index c46caa28e7cdc9b02df24e3c0373f1780a5a8073,54f99d570e803f021a533615f31ac21f3b800f82..e3e2775fb03a729690030e1e0aafca025cadb14c
@@@ -47,8 -32,8 +47,9 @@@ class InitialStateSerializer < ActiveMo
        store[:expand_spoilers] = object.current_account.user.setting_expand_spoilers
        store[:reduce_motion]   = object.current_account.user.setting_reduce_motion
        store[:advanced_layout] = object.current_account.user.setting_advanced_layout
+       store[:use_blurhash]    = object.current_account.user.setting_use_blurhash
        store[:is_staff]        = object.current_account.user.staff?
 +      store[:default_content_type] = object.current_account.user.setting_default_content_type
      end
  
      store
index e5e12c05a235ae1d7b57e5fe300c69721ffa10ed,75cbec9de5f28e46ae6ceb9ee48eaaf601ffccca..b35b9b6ecb88eb166f5d2dd95a7ad8a833210286
@@@ -38,7 -34,7 +38,8 @@@ en
          setting_hide_network: Who you follow and who follows you will not be shown on your profile
          setting_noindex: Affects your public profile and status pages
          setting_show_application: The application you use to toot will be displayed in the detailed view of your toots
 +        setting_skin: Reskins the selected Mastodon flavour
+         setting_use_blurhash: Gradients are based on the colors of the hidden visuals but obfuscate any details
          username: Your username will be unique on %{domain}
          whole_word: When the keyword or phrase is alphanumeric only, it will only be applied if it matches the whole word
        featured_tag:
          setting_noindex: Opt-out of search engine indexing
          setting_reduce_motion: Reduce motion in animations
          setting_show_application: Disclose application used to send toots
 +        setting_skin: Skin
          setting_system_font_ui: Use system's default font
 -        setting_theme: Site theme
          setting_unfollow_modal: Show confirmation dialog before unfollowing someone
+         setting_use_blurhash: Show colorful gradients for hidden media
          severity: Severity
          type: Import type
          username: Username
index 97da9883ee41590b399e9f105d84b1077dbd78f0,ad71b6008fa20afae7982f7cc01a226095abc8fa..07e24f8e2eb98852edc9a4994b8bc1690f47af48
@@@ -27,15 -26,13 +27,16 @@@ defaults: &default
    expand_spoilers: false
    preview_sensitive_media: false
    reduce_motion: false
 -  show_application: true
 +  show_application: false
    system_font_ui: false
    noindex: false
 -  theme: 'default'
 +  hide_followers_count: false
 +  enable_keybase: true
 +  flavour: 'glitch'
 +  skin: 'default'
    aggregate_reblogs: true
    advanced_layout: false
+   use_blurhash: true
    notification_emails:
      follow: false
      reblog: false
diff --cc package.json
index 87b4ead51141008a74f99ed8be165e8a5d1678b0,b45fad6377ffdaa0e1b1b9771e46aee11ad97d97..c1a6a3b9be3ab8b5cb2a703d5a8d474b93edd46c
      "@babel/runtime": "^7.4.5",
      "@clusterws/cws": "^0.14.0",
      "array-includes": "^3.0.3",
 +    "atrament": "^0.2.3",
      "autoprefixer": "^9.6.0",
      "axios": "^0.19.0",
-     "babel-loader": "^8.0.5",
+     "babel-loader": "^8.0.6",
      "babel-plugin-lodash": "^3.3.4",
      "babel-plugin-preval": "^3.0.1",
      "babel-plugin-react-intl": "^3.1.3",
Simple merge
diff --cc yarn.lock
Simple merge