]> cat aescling's git repositories - mastodon.git/commitdiff
Merge branch 'master' into glitch-soc/merge-upstream
authorThibaut Girka <thib@sitedethib.com>
Mon, 30 Sep 2019 10:23:57 +0000 (12:23 +0200)
committerThibaut Girka <thib@sitedethib.com>
Mon, 30 Sep 2019 10:23:57 +0000 (12:23 +0200)
Conflicts:
- Gemfile
- Gemfile.lock
- app/controllers/about_controller.rb
- app/controllers/auth/sessions_controller.rb

43 files changed:
1  2 
.env.production.sample
Gemfile
Gemfile.lock
app/controllers/about_controller.rb
app/controllers/accounts_controller.rb
app/controllers/api/v2/search_controller.rb
app/controllers/auth/sessions_controller.rb
app/controllers/directories_controller.rb
app/controllers/follower_accounts_controller.rb
app/controllers/following_accounts_controller.rb
app/controllers/remote_follow_controller.rb
app/controllers/remote_interaction_controller.rb
app/controllers/statuses_controller.rb
app/controllers/tags_controller.rb
app/javascript/mastodon/locales/defaultMessages.json
app/javascript/mastodon/locales/en.json
app/javascript/mastodon/locales/ja.json
app/javascript/mastodon/locales/pl.json
app/javascript/packs/public.js
app/javascript/styles/mastodon/admin.scss
app/javascript/styles/mastodon/components.scss
app/models/concerns/account_associations.rb
app/models/status.rb
app/models/user.rb
app/presenters/instance_presenter.rb
app/serializers/activitypub/note_serializer.rb
app/services/post_status_service.rb
app/views/about/more.html.haml
app/views/admin/dashboard/index.html.haml
app/views/admin/tags/index.html.haml
app/views/layouts/admin.html.haml
app/views/settings/profiles/show.html.haml
config/locales/en.yml
config/locales/ja.yml
config/locales/pl.yml
config/locales/simple_form.en.yml
config/locales/simple_form.ja.yml
config/navigation.rb
config/routes.rb
db/schema.rb
lib/mastodon/version.rb
package.json
yarn.lock

Simple merge
diff --cc Gemfile
index 2505194c879e19f0ebf6c10e8b1194b26db615c2,7ed1a4e6bb78eb007e68b5903144a4a8716ca37e..45a8444fdcd9f36f3a70f3df97756b1710414005
+++ b/Gemfile
@@@ -50,8 -50,7 +50,8 @@@ gem 'fastimage
  gem 'goldfinger', '~> 2.1'
  gem 'hiredis', '~> 0.6'
  gem 'redis-namespace', '~> 1.5'
- gem 'health_check', '~> 3.0'
+ gem 'health_check', git: 'https://github.com/ianheggie/health_check', ref: '0b799ead604f900ed50685e9b2d469cd2befba5b'
 +gem 'html2text'
  gem 'htmlentities', '~> 4.3'
  gem 'http', '~> 3.3'
  gem 'http_accept_language', '~> 2.1'
diff --cc Gemfile.lock
index 092f69119948de713e4b2d56d931079ca01d84c7,fdf28bd10d706ad0fe475a88960d083889969af7..c05b85b2aaa74eed58a6aa634532d5ab62dc234a
@@@ -502,8 -506,7 +508,8 @@@ GE
        link_header (~> 0.0, >= 0.0.8)
      rdf-normalize (0.3.3)
        rdf (>= 2.2, < 4.0)
-     redis (4.1.2)
 +    redcarpet (3.4.0)
+     redis (4.1.3)
      redis-actionpack (5.0.2)
        actionpack (>= 4.0, < 6)
        redis-rack (>= 1, < 3)
@@@ -711,9 -714,8 +717,9 @@@ DEPENDENCIE
    fuubar (~> 2.4)
    goldfinger (~> 2.1)
    hamlit-rails (~> 0.2)
-   health_check (~> 3.0)
+   health_check!
    hiredis (~> 0.6)
 +  html2text
    htmlentities (~> 4.3)
    http (~> 3.3)
    http_accept_language (~> 2.1)
index 7b04381278f55acf08c96538577bfa4e0cf23076,abd1ec0cb647296b08ee042e3c89a8cfe0d7946c..5d5db937c2533a672b06cd2e01d1c74df5b8cbf5
@@@ -1,12 -1,9 +1,10 @@@
  # frozen_string_literal: true
  
  class AboutController < ApplicationController
 +  before_action :set_pack
    layout 'public'
  
-   before_action :require_open_federation!, only: [:show, :more, :blocks]
-   before_action :check_blocklist_enabled, only: [:blocks]
-   before_action :authenticate_user!, only: [:blocks], if: :blocklist_account_required?
+   before_action :require_open_federation!, only: [:show, :more]
    before_action :set_body_classes, only: :show
    before_action :set_instance_presenter
    before_action :set_expires_in, only: [:show, :more, :terms]
      end
    end
  
-   helper_method :new_user
 +  def set_pack
 +    use_pack 'public'
 +  end
 +
    def set_instance_presenter
      @instance_presenter = InstancePresenter.new
    end
index c2b38883ba992b9c8ad2ea65bd6a639b3e0b917d,f48b17c79935ceb3bb9141c1bab52fc9aa296a0d..efde02ac2a92f806192a88deecfaac0d21c39ff2
@@@ -8,7 -8,7 +8,8 @@@ class Auth::SessionsController < Devise
    skip_before_action :require_no_authentication, only: [:create]
    skip_before_action :require_functional!
  
 +  prepend_before_action :set_pack
+   prepend_before_action :authenticate_with_two_factor, if: :two_factor_enabled?, only: [:create]
  
    before_action :set_instance_presenter, only: [:new]
    before_action :set_body_classes
      render :two_factor
    end
  
-   def authenticate_and_respond(user)
-     sign_in(user)
-     remember_me(user)
-     respond_with user, location: after_sign_in_path_for(user)
-   end
    private
  
 +  def set_pack
 +    use_pack 'auth'
 +  end
 +
    def set_instance_presenter
      @instance_presenter = InstancePresenter.new
    end
index bbfdde8af3adcf6339d0cb2882fa6554512c4acd,750c835ddab471e1536327e6486ad19b1ddcd7e8..adf2bd0146f82bd58aa21f86c5150a0e4f68acb3
@@@ -8,8 -8,9 +8,10 @@@ class DirectoriesController < Applicati
    before_action :set_instance_presenter
    before_action :set_tag, only: :show
    before_action :set_accounts
 +  before_action :set_pack
  
+   skip_before_action :require_functional!
    def index
      render :index
    end
index 65dfa35db0f1b11be2ffef80dd7e768d52a9c9ed,db1604644f124cb5040f00f83399be9c1b1c0754..93a0a74764027c7512010166c92ad2aafa66db6d
@@@ -5,9 -5,10 +5,11 @@@ class RemoteFollowController < Applicat
  
    layout 'modal'
  
 +  before_action :set_pack
    before_action :set_body_classes
  
+   skip_before_action :require_functional!
    def new
      @remote_follow = RemoteFollow.new(session_params)
    end
index 6b797b10ffc93d90f71943106070d9908ea1c424,4073e7ac3faa94614526690233475c8fbe1a9506..e058d0ed5b52cd6e0502d28f330884ad5ea31695
@@@ -9,8 -9,9 +9,10 @@@ class RemoteInteractionController < App
    before_action :set_interaction_type
    before_action :set_status
    before_action :set_body_classes
 +  before_action :set_pack
  
+   skip_before_action :require_functional!
    def new
      @remote_follow = RemoteFollow.new(session_params)
    end
Simple merge
index 64baed71d0a61c9ec7c4d289b467bc11e1230cc6,ee31d3ae32269db47e805c07dc912fb1d1d4b05a..d59b2c7f297fa6db796a33870c1d4a719dca018a
    "navigation_bar.pins": "固定したトゥート",
    "navigation_bar.preferences": "ユーザー設定",
    "navigation_bar.public_timeline": "連合タイムライン",
 +  "navigation_bar.misc": "その他",
    "navigation_bar.security": "セキュリティ",
-   "notification.and_n_others": "and {count, plural, one {# other} other {# others}}",
+   "notification.and_n_others": "と、他 {count} 件",
    "notification.favourite": "{name}さんがあなたのトゥートをお気に入りに登録しました",
    "notification.follow": "{name}さんにフォローされました",
    "notification.mention": "{name}さんがあなたに返信しました",
index 9418188a7c050d321b9858227017d1237981ce0f,ed713f335ae7ac6d685ae9a66e5799aca4f0f223..1229a75055ec5086b13f981ef500e6c4eaa689a7
@@@ -100,16 -117,146 +100,26 @@@ function main() 
  
      delegate(document, '.custom-emoji', 'mouseover', getEmojiAnimationHandler('data-original'));
      delegate(document, '.custom-emoji', 'mouseout', getEmojiAnimationHandler('data-static'));
 -  });
 -
 -  delegate(document, '.webapp-btn', 'click', ({ target, button }) => {
 -    if (button !== 0) {
 -      return true;
 -    }
 -    window.location.href = target.href;
 -    return false;
 -  });
 -
 -  delegate(document, '.status__content__spoiler-link', 'click', function() {
 -    const contentEl = this.parentNode.parentNode.querySelector('.e-content');
 -
 -    if (contentEl.style.display === 'block') {
 -      contentEl.style.display = 'none';
 -      this.parentNode.style.marginBottom = 0;
 -    } else {
 -      contentEl.style.display = 'block';
 -      this.parentNode.style.marginBottom = null;
 -    }
 -
 -    return false;
 -  });
 -
 -  delegate(document, '.blocks-table button.icon-button', 'click', function(e) {
 -    e.preventDefault();
 -
 -    const classList = this.firstElementChild.classList;
 -    classList.toggle('fa-chevron-down');
 -    classList.toggle('fa-chevron-up');
 -    this.parentElement.parentElement.nextElementSibling.classList.toggle('hidden');
 -  });
 -
 -  delegate(document, '.modal-button', 'click', e => {
 -    e.preventDefault();
 -
 -    let href;
 -
 -    if (e.target.nodeName !== 'A') {
 -      href = e.target.parentNode.href;
 -    } else {
 -      href = e.target.href;
 -    }
 -
 -    window.open(href, 'mastodon-intent', 'width=445,height=600,resizable=no,menubar=no,status=no,scrollbars=yes');
 -  });
 -
 -  delegate(document, '#account_display_name', 'input', ({ target }) => {
 -    const name = document.querySelector('.card .display-name strong');
 -    if (name) {
 -      if (target.value) {
 -        name.innerHTML = emojify(escapeTextContentForBrowser(target.value));
 -      } else {
 -        name.textContent = document.querySelector('#default_account_display_name').textContent;
 -      }
 -    }
 -  });
 -
 -  delegate(document, '#account_avatar', 'change', ({ target }) => {
 -    const avatar = document.querySelector('.card .avatar img');
 -    const [file] = target.files || [];
 -    const url = file ? URL.createObjectURL(file) : avatar.dataset.originalSrc;
 -
 -    avatar.src = url;
 -  });
 -
 -  const getProfileAvatarAnimationHandler = (swapTo) => {
 -    //animate avatar gifs on the profile page when moused over
 -    return ({ target }) => {
 -      const swapSrc = target.getAttribute(swapTo);
 -      //only change the img source if autoplay is off and the image src is actually different
 -      if(target.getAttribute('data-autoplay') !== 'true' && target.src !== swapSrc) {
 -        target.src = swapSrc;
 -      }
 -    };
 -  };
 -
 -  delegate(document, 'img#profile_page_avatar', 'mouseover', getProfileAvatarAnimationHandler('data-original'));
 -
 -  delegate(document, 'img#profile_page_avatar', 'mouseout', getProfileAvatarAnimationHandler('data-static'));
 -
 -  delegate(document, '#account_header', 'change', ({ target }) => {
 -    const header = document.querySelector('.card .card__img img');
 -    const [file] = target.files || [];
 -    const url = file ? URL.createObjectURL(file) : header.dataset.originalSrc;
 -
 -    header.src = url;
 -  });
  
 -  delegate(document, '#account_locked', 'change', ({ target }) => {
 -    const lock = document.querySelector('.card .display-name i');
 +    delegate(document, '.blocks-table button.icon-button', 'click', function(e) {
 +      e.preventDefault();
  
 -    if (target.checked) {
 -      lock.style.display = 'inline';
 -    } else {
 -      lock.style.display = 'none';
 -    }
 -  });
 -
 -  delegate(document, '.input-copy input', 'click', ({ target }) => {
 -    target.focus();
 -    target.select();
 -    target.setSelectionRange(0, target.value.length);
 -  });
 -
 -  delegate(document, '.input-copy button', 'click', ({ target }) => {
 -    const input = target.parentNode.querySelector('.input-copy__wrapper input');
 -
 -    const oldReadOnly = input.readonly;
 -
 -    input.readonly = false;
 -    input.focus();
 -    input.select();
 -    input.setSelectionRange(0, input.value.length);
 -
 -    try {
 -      if (document.execCommand('copy')) {
 -        input.blur();
 -        target.parentNode.classList.add('copied');
 -
 -        setTimeout(() => {
 -          target.parentNode.classList.remove('copied');
 -        }, 700);
 -      }
 -    } catch (err) {
 -      console.error(err);
 -    }
 -
 -    input.readonly = oldReadOnly;
 +      const classList = this.firstElementChild.classList;
 +      classList.toggle('fa-chevron-down');
 +      classList.toggle('fa-chevron-up');
 +      this.parentElement.parentElement.nextElementSibling.classList.toggle('hidden');
 +    });
    });
+   delegate(document, '.sidebar__toggle__icon', 'click', () => {
+     const target = document.querySelector('.sidebar ul');
+     if (target.style.display === 'block') {
+       target.style.display = 'none';
+     } else {
+       target.style.display = 'block';
+     }
+   });
  }
  
  loadPolyfills().then(main).catch(error => {
index b0f610aa2f0aa4e4d1dd9d81981ddf56f0bfaf46,5e74745775d7ffdc83c1a17b7ff24bc1c0d695b8..202434db32d85f83a3cf743039cae58d14323101
@@@ -355,12 -304,8 +355,12 @@@ class Status < ApplicationRecor
        Favourite.select('status_id').where(status_id: status_ids).where(account_id: account_id).each_with_object({}) { |f, h| h[f.status_id] = true }
      end
  
 +    def bookmarks_map(status_ids, account_id)
 +      Bookmark.select('status_id').where(status_id: status_ids).where(account_id: account_id).map { |f| [f.status_id, true] }.to_h
 +    end
 +
      def reblogs_map(status_ids, account_id)
-       select('reblog_of_id').where(reblog_of_id: status_ids).where(account_id: account_id).reorder(nil).each_with_object({}) { |s, h| h[s.reblog_of_id] = true }
+       unscoped.select('reblog_of_id').where(reblog_of_id: status_ids).where(account_id: account_id).each_with_object({}) { |s, h| h[s.reblog_of_id] = true }
      end
  
      def mutes_map(conversation_ids, account_id)
Simple merge
Simple merge
index f1cebbcd4de7c186b38dc116a8d257f11c16f3f0,110621a28bf88ec6498b776368bac696bfa0fdc5..dce506fa2326bbec592b3176dd617c2bdc828d10
@@@ -23,8 -23,9 +23,10 @@@ class ActivityPub::NoteSerializer < Act
    attribute :end_time, if: :poll_and_expires?
    attribute :closed, if: :poll_and_expired?
  
+   attribute :voters_count, if: :poll_and_voters_count?
    def id
 +    raise Mastodon::NotPermittedError, 'Local-only statuses should not be serialized' if object.local_only? && !instance_options[:allow_local_only]
      ActivityPub::TagManager.instance.uri_for(object)
    end
  
Simple merge
index 4922f0f54f6281fc1b22cac14e7ced7b889702a2,7e156db61b636765da490232c17c7b2694a73328..03be3f4232257211b53caa53da8638c2a2eae4e1
@@@ -2,9 -2,10 +2,9 @@@
    = site_hostname
  
  - content_for :header_tags do
 -  = javascript_pack_tag 'public', integrity: true, crossorigin: 'anonymous'
    = render partial: 'shared/og'
  
- .grid-3
+ .grid-4
    .column-0
      .public-account-header.public-account-header--no-bar
        .public-account-header__image
Simple merge
Simple merge
Simple merge
index f39e048ca2da43572e981c7885fa85df720e588c,4b850a8a81fc7b88185d563cdd8447b47b8c82f8..3ad4cf3e9aa98e9e2275c353f7f6b8327071a7af
@@@ -705,9 -735,9 +735,10 @@@ ja
      all: すべて
      changes_saved_msg: 正常に変更されました!
      copy: コピー
+     no_batch_actions_available: 利用可能なバッチアクションはありません
      order_by: 並び順
      save_changes: 変更を保存
 +    use_this: これを使う
      validation_errors:
        other: エラーが発生しました! 以下の%{count}個のエラーを確認してください
    html_validator:
Simple merge
Simple merge
Simple merge
Simple merge
index 416bd833ebe233f7604291a056771b4c874a3b2d,e43e201a5d78f0a18280da8e76e9d4c6eaf4a2d1..49edb4602558906ccb439a657c1db9439c9e436a
@@@ -132,11 -136,14 +136,16 @@@ Rails.application.routes.draw d
        end
      end
  
 +    resources :flavours, only: [:index, :show, :update], param: :flavour
 +
      resource :delete, only: [:show, :destroy]
-     resource :migration, only: [:show, :update]
+     resource :migration, only: [:show, :create]
+     namespace :migration do
+       resource :redirect, only: [:new, :create, :destroy]
+     end
  
+     resources :aliases, only: [:index, :create, :destroy]
      resources :sessions, only: [:destroy]
      resources :featured_tags, only: [:index, :create, :destroy]
    end
diff --cc db/schema.rb
Simple merge
Simple merge
diff --cc package.json
Simple merge
diff --cc yarn.lock
Simple merge