]> cat aescling's git repositories - mastodon.git/commitdiff
Merge branch 'master' into glitch-soc/merge-upstream
authorThibaut Girka <thib@sitedethib.com>
Wed, 21 Oct 2020 17:10:50 +0000 (19:10 +0200)
committerThibaut Girka <thib@sitedethib.com>
Wed, 21 Oct 2020 17:10:50 +0000 (19:10 +0200)
Conflicts:
- `.github/dependabot.yml`:
  Updated upstream, we deleted it to not be flooded by Depandabot.
  Kept deleted.
- `Gemfile.lock`:
  Puma updated on both sides, went for the most recent version.
- `app/controllers/api/v1/mutes_controller.rb`:
  Upstream updated the serializer to support timed mutes, while
  glitch-soc added a custom API ages ago to get information that
  is already available elsewhere.
  Dropped the glitch-soc-specific API, went with upstream changes.
- `app/javascript/core/admin.js`:
  Conflict due to changing how assets are loaded. Went with upstream.
- `app/javascript/packs/public.js`:
  Conflict due to changing how assets are loaded. Went with upstream.
- `app/models/mute.rb`:
  🤷
- `app/models/user.rb`:
  New user setting added upstream while we have glitch-soc-specific
  user settings. Added upstream's user setting.
- `config/settings.yml`:
  Upstream added a new user setting close to a user setting we had
  changed the defaults for. Added the new upstream setting.
- `package.json`:
  Upstream dependency updated “too close” to a glitch-soc-specific
  dependency. No real conflict. Updated the dependency.

32 files changed:
1  2 
Gemfile
Gemfile.lock
app/controllers/auth/registrations_controller.rb
app/controllers/settings/preferences_controller.rb
app/javascript/core/admin.js
app/javascript/mastodon/initial_state.js
app/javascript/mastodon/locales/defaultMessages.json
app/javascript/mastodon/locales/en.json
app/javascript/mastodon/locales/ja.json
app/javascript/packs/public.js
app/javascript/styles/mastodon/components.scss
app/lib/sanitize_config.rb
app/lib/settings/scoped_settings.rb
app/lib/user_settings_decorator.rb
app/models/account.rb
app/models/mute.rb
app/models/user.rb
app/serializers/initial_state_serializer.rb
app/services/process_mentions_service.rb
app/views/layouts/application.html.haml
app/views/layouts/embedded.html.haml
app/views/settings/preferences/appearance/show.html.haml
app/views/statuses/_simple_status.html.haml
config/navigation.rb
config/routes.rb
config/settings.yml
config/webpack/configuration.js
db/schema.rb
package.json
spec/lib/feed_manager_spec.rb
spec/models/concerns/account_interactions_spec.rb
yarn.lock

diff --cc Gemfile
Simple merge
diff --cc Gemfile.lock
Simple merge
index 87431f8cf2dd44ec1e8eaf860a295e0e4d4819b2,32b5d79487b7411c7a08071e6e1832db76cd038d..d05ceb53f63277217202b298db5f874bdb6f3784
@@@ -44,11 -43,11 +44,12 @@@ class Settings::PreferencesController 
        :setting_display_media,
        :setting_expand_spoilers,
        :setting_reduce_motion,
+       :setting_disable_swiping,
        :setting_system_font_ui,
 +      :setting_system_emoji_font,
        :setting_noindex,
 -      :setting_theme,
        :setting_hide_network,
 +      :setting_hide_followers_count,
        :setting_aggregate_reblogs,
        :setting_show_application,
        :setting_advanced_layout,
index f2334c254b38024589f629beec002423e08c97ed,65b8dc040d24d4f3ac8f19da815c7009256be90b..b9cc00d649c9cb13146aadf7f6f8c2a1f0de460c
@@@ -1,5 -1,4 +1,6 @@@
 +//  This file will be loaded on admin pages, regardless of theme.
 +
+ import './public-path';
  import { delegate } from '@rails/ujs';
  import ready from '../mastodon/ready';
  
index 5ad25a9b0f559741494f6ea24150dece0ac6d33b,39defa7ae9ee8d1e14bedcb2092d7eacfb42961f..3f67001959c6a77cdc67ca8b45eced1ff0a02436
@@@ -1,3 -1,5 +1,4 @@@
 -import escapeTextContentForBrowser from 'escape-html';
+ import './public-path';
  import loadPolyfills from '../mastodon/load_polyfills';
  import ready from '../mastodon/ready';
  import { start } from '../mastodon/common';
Simple merge
Simple merge
index 2f9cfe3adf84538eaad7aa840a1194996ee675ce,e37bc6d9f11437a0f53794da3aedbae7b126635d..581101782f70b69b4065ef4d7aa8f5ffadd82b0e
@@@ -28,12 -27,10 +28,13 @@@ class UserSettingsDecorato
      user.settings['display_media']       = display_media_preference if change?('setting_display_media')
      user.settings['expand_spoilers']     = expand_spoilers_preference if change?('setting_expand_spoilers')
      user.settings['reduce_motion']       = reduce_motion_preference if change?('setting_reduce_motion')
+     user.settings['disable_swiping']     = disable_swiping_preference if change?('setting_disable_swiping')
      user.settings['system_font_ui']      = system_font_ui_preference if change?('setting_system_font_ui')
 +    user.settings['system_emoji_font']   = system_emoji_font_preference if change?('setting_system_emoji_font')
      user.settings['noindex']             = noindex_preference if change?('setting_noindex')
 -    user.settings['theme']               = theme_preference if change?('setting_theme')
 +    user.settings['hide_followers_count']= hide_followers_count_preference if change?('setting_hide_followers_count')
 +    user.settings['flavour']             = flavour_preference if change?('setting_flavour')
 +    user.settings['skin']                = skin_preference if change?('setting_skin')
      user.settings['hide_network']        = hide_network_preference if change?('setting_hide_network')
      user.settings['aggregate_reblogs']   = aggregate_reblogs_preference if change?('setting_aggregate_reblogs')
      user.settings['show_application']    = show_application_preference if change?('setting_show_application')
Simple merge
index 639120f7dda9107f6126b167c6ebcbb2eb9a79eb,578345ef644ad4459a90fde1be38c540d7e5cb82..fe8b6f42c81ae965495e1735137ccdb4e64371e8
@@@ -6,9 -6,10 +6,11 @@@
  #  id                 :bigint(8)        not null, primary key
  #  created_at         :datetime         not null
  #  updated_at         :datetime         not null
 +#  hide_notifications :boolean          default(TRUE), not null
  #  account_id         :bigint(8)        not null
  #  target_account_id  :bigint(8)        not null
+ #  hide_notifications :boolean          default(TRUE), not null
+ #  expires_at         :datetime
  #
  
  class Mute < ApplicationRecord
index 6cd2ca6bdcafac8918344d82b45519fdfce6c5ab,7c8124fedb9c1ebc496be5507d6685e88775bcb3..3dcfd820e0dd686e2c6e7fa62e006c433580c61b
@@@ -111,11 -112,11 +112,11 @@@ 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, :use_blurhash, :use_pending_items, :trends, :crop_images,
-            :default_content_type, :system_emoji_font,
 -           :disable_swiping,
++           :disable_swiping, :default_content_type, :system_emoji_font,
             to: :settings, prefix: :setting, allow_nil: false
  
    attr_reader :invite_code, :sign_in_token_attempt
Simple merge
index 5fc865814a0a1112a194911b437ab4a610013e87,14941d5fd3f6edc7ee26630e6406efac8332a3ac..ccea2e9b7fe929e8a7f5779dfbbc503b4f898839
@@@ -27,8 -30,8 +27,9 @@@
    .fields-group
      = f.input :setting_auto_play_gif, as: :boolean, wrapper: :with_label, recommended: true
      = f.input :setting_reduce_motion, as: :boolean, wrapper: :with_label
+     = f.input :setting_disable_swiping, as: :boolean, wrapper: :with_label
      = f.input :setting_system_font_ui, as: :boolean, wrapper: :with_label
 +    = f.input :setting_system_emoji_font, as: :boolean, wrapper: :with_label
  
    %h4= t 'appearance.toot_layout'
  
Simple merge
Simple merge
index c61454e9ebc79385861f1dad00b259d1cf5a724d,217745f28e550e46868d69b1f53555e309acd9a7..4d6a1cffcaafb5e3c618745f82b65a7a5268b065
@@@ -27,14 -26,11 +27,15 @@@ defaults: &default
    expand_spoilers: false
    preview_sensitive_media: false
    reduce_motion: false
 -  show_application: true
+   disable_swiping: false
 +  show_application: false
    system_font_ui: false
 +  system_emoji_font: 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
index 926af9b397e24290f39a11e6c995d3408a65ac86,e4f88a9c4dfd6f3bc30c7b525926f35844674e3e..b34ba0e0a6bdca596b884d7c091d3a7f6a870837
@@@ -8,80 -7,21 +8,67 @@@ const glob = require('glob')
  
  const configPath = resolve('config', 'webpacker.yml');
  const settings = safeLoad(readFileSync(configPath), 'utf8')[env.RAILS_ENV || env.NODE_ENV];
 +const flavourFiles = glob.sync('app/javascript/flavours/*/theme.yml');
 +const skinFiles = glob.sync('app/javascript/skins/*/*');
 +const flavours = {};
  
 -const themePath = resolve('config', 'themes.yml');
 -const themes = safeLoad(readFileSync(themePath), 'utf8');
 +const core = function () {
 +  const coreFile = resolve('app', 'javascript', 'core', 'theme.yml');
 +  const data = safeLoad(readFileSync(coreFile), 'utf8');
 +  if (!data.pack_directory) {
 +    data.pack_directory = dirname(coreFile);
 +  }
 +  return data.pack ? data : {};
 +}();
 +
 +for (let i = 0; i < flavourFiles.length; i++) {
 +  const flavourFile = flavourFiles[i];
 +  const data = safeLoad(readFileSync(flavourFile), 'utf8');
 +  data.name = basename(dirname(flavourFile));
 +  data.skin = {};
 +  if (!data.pack_directory) {
 +    data.pack_directory = dirname(flavourFile);
 +  }
 +  if (data.locales) {
 +    data.locales = join(dirname(flavourFile), data.locales);
 +  }
 +  if (data.pack && typeof data.pack === 'object') {
 +    flavours[data.name] = data;
 +  }
 +}
 +
 +for (let i = 0; i < skinFiles.length; i++) {
 +  const skinFile = skinFiles[i];
 +  let skin = basename(skinFile);
 +  const name = basename(dirname(skinFile));
 +  if (!flavours[name]) {
 +    continue;
 +  }
 +  const data = flavours[name].skin;
 +  if (lstatSync(skinFile).isDirectory()) {
 +    data[skin] = {};
 +    const skinPacks = glob.sync(join(skinFile, '*.{css,scss}'));
 +    for (let j = 0; j < skinPacks.length; j++) {
 +      const pack = skinPacks[j];
 +      data[skin][basename(pack, extname(pack))] = pack;
 +    }
 +  } else if ((skin = skin.match(/^(.*)\.s?css$/i))) {
 +    data[skin[1]] = { common: skinFile };
 +  }
 +}
  
- function removeOuterSlashes(string) {
-   return string.replace(/^\/*/, '').replace(/\/*$/, '');
- }
- function formatPublicPath(host = '', path = '') {
-   let formattedHost = removeOuterSlashes(host);
-   if (formattedHost && !/^http/i.test(formattedHost)) {
-     formattedHost = `//${formattedHost}`;
-   }
-   const formattedPath = removeOuterSlashes(path);
-   return `${formattedHost}/${formattedPath}/`;
- }
  const output = {
    path: resolve('public', settings.public_output_path),
-   publicPath: formatPublicPath(env.CDN_HOST, settings.public_output_path),
+   publicPath: `/${settings.public_output_path}/`,
  };
  
  module.exports = {
    settings,
 -  themes,
 +  core,
 +  flavours,
    env: {
-     CDN_HOST: env.CDN_HOST,
      NODE_ENV: env.NODE_ENV,
+     PUBLIC_OUTPUT_PATH: settings.public_output_path,
    },
    output,
  };
diff --cc db/schema.rb
Simple merge
diff --cc package.json
index 30dfbc47125f96f16725705ab324bf90092a14b2,833bfe79443b0f7194d447d0d6513d4272eff67c..5d07f31a5d6c3cfce7a60e1f9e876d431320b9b2
      "@babel/runtime": "^7.11.2",
      "@clusterws/cws": "^3.0.0",
      "@gamestdio/websocket": "^0.3.2",
-     "@github/webauthn-json": "^0.5.4",
+     "@github/webauthn-json": "^0.5.6",
      "@rails/ujs": "^6.0.3",
      "array-includes": "^3.1.1",
 +    "atrament": "0.2.4",
      "arrow-key-navigation": "^1.2.0",
      "autoprefixer": "^9.8.6",
      "axios": "^0.20.0",
@@@ -96,8 -94,7 +96,8 @@@
      "escape-html": "^1.0.3",
      "exif-js": "^2.3.0",
      "express": "^4.17.1",
-     "file-loader": "^6.1.0",
 +    "favico.js": "^0.3.10",
+     "file-loader": "^6.1.1",
      "font-awesome": "^4.7.0",
      "glob": "^7.1.6",
      "history": "^4.10.1",
Simple merge
diff --cc yarn.lock
Simple merge