From: Thibaut Girka Date: Sun, 10 Feb 2019 19:57:51 +0000 (+0100) Subject: Merge branch 'master' into glitch-soc/merge-upstream X-Git-Url: https://git.xn--scling-oua.cat.family/?a=commitdiff_plain;h=bf94a43496210bd99c5344f10f7fbf3c49fd15b8;p=mastodon.git Merge branch 'master' into glitch-soc/merge-upstream Conflicts: - app/controllers/oauth/authorized_applications_controller.rb Two changes too close to each other - app/controllers/settings/sessions_controller.rb - app/lib/user_settings_decorator.rb Two changes too close to each other - app/models/media_attachment.rb New changes too close to glitch-soc only changes. - app/models/user.rb Two changes too close to each other. - app/services/remove_status_service.rb Kept direct timeline code which had been removed upstream. - app/views/settings/preferences/show.html.haml Two changes too close to each other. - config/locales/en.yml Introduction of a new string too close to glitch-soc-only's “flavour” - config/locales/ja.yml Introduction of a new string too close to glitch-soc-only's “flavour” - config/locales/pl.yml Introduction of a new string too close to glitch-soc-only's “flavour” - config/locales/simple_form.en.yml Introduction of a new string too close to glitch-soc-only's “skin” - config/locales/simple_form.pl.yml Introduction of a new string too close to glitch-soc-only's “skin” - config/settings.yml Reverted upstream's decision of enabling posting application by default. --- bf94a43496210bd99c5344f10f7fbf3c49fd15b8 diff --cc Dockerfile index aefcb44bd,2b15381ec..eca90094c --- a/Dockerfile +++ b/Dockerfile @@@ -64,12 -63,9 +63,12 @@@ RUN apk add --no-cache -t build-depende && make install \ && libtool --finish /usr/local/lib \ && cd /mastodon \ - && rm -rf /tmp/* /var/cache/apk/* + && rm -rf /tmp/* COPY Gemfile Gemfile.lock package.json yarn.lock .yarnclean /mastodon/ +COPY stack-fix.c /lib +RUN gcc -shared -fPIC /lib/stack-fix.c -o /lib/stack-fix.so +RUN rm /lib/stack-fix.c RUN bundle config build.nokogiri --use-system-libraries --with-iconv-lib=/usr/local/lib --with-iconv-include=/usr/local/include \ && bundle install -j$(getconf _NPROCESSORS_ONLN) --deployment --without test development \ diff --cc app/controllers/oauth/authorized_applications_controller.rb index 1e420b3e7,f3d235366..4e45445df --- a/app/controllers/oauth/authorized_applications_controller.rb +++ b/app/controllers/oauth/authorized_applications_controller.rb @@@ -5,7 -5,7 +5,8 @@@ class Oauth::AuthorizedApplicationsCont before_action :store_current_location before_action :authenticate_resource_owner! + before_action :set_pack + before_action :set_body_classes include Localized diff --cc app/controllers/settings/sessions_controller.rb index 780ea64b4,84ebb21f2..d74db6000 --- a/app/controllers/settings/sessions_controller.rb +++ b/app/controllers/settings/sessions_controller.rb @@@ -1,7 -1,7 +1,8 @@@ # frozen_string_literal: true -class Settings::SessionsController < Settings::BaseController +# Intentionally does not inherit from BaseController +class Settings::SessionsController < ApplicationController + before_action :authenticate_user! before_action :set_session, only: :destroy def destroy diff --cc app/javascript/mastodon/locales/en.json index 3bb157aeb,03af57ba8..b079f256d --- a/app/javascript/mastodon/locales/en.json +++ b/app/javascript/mastodon/locales/en.json @@@ -228,10 -224,9 +228,10 @@@ "navigation_bar.favourites": "Favourites", "navigation_bar.filters": "Muted words", "navigation_bar.follow_requests": "Follow requests", - "navigation_bar.info": "About this instance", + "navigation_bar.info": "About this server", "navigation_bar.keyboard_shortcuts": "Hotkeys", "navigation_bar.lists": "Lists", + "navigation_bar.misc": "Misc", "navigation_bar.logout": "Logout", "navigation_bar.mutes": "Muted users", "navigation_bar.personal": "Personal", diff --cc app/models/media_attachment.rb index 601b14223,a57ba0b2e..81397a18e --- a/app/models/media_attachment.rb +++ b/app/models/media_attachment.rb @@@ -23,16 -23,14 +23,16 @@@ class MediaAttachment < ApplicationRecord self.inheritance_column = nil - enum type: [:image, :gifv, :video, :unknown] + enum type: [:image, :gifv, :video, :audio, :unknown] - IMAGE_FILE_EXTENSIONS = ['.jpg', '.jpeg', '.png', '.gif'].freeze + IMAGE_FILE_EXTENSIONS = ['.jpg', '.jpeg', '.png', '.gif', '.webp'].freeze VIDEO_FILE_EXTENSIONS = ['.webm', '.mp4', '.m4v', '.mov'].freeze + AUDIO_FILE_EXTENSIONS = ['.mp3', '.m4a', '.wav', '.ogg'].freeze - IMAGE_MIME_TYPES = ['image/jpeg', 'image/png', 'image/gif'].freeze + IMAGE_MIME_TYPES = ['image/jpeg', 'image/png', 'image/gif', 'image/webp'].freeze VIDEO_MIME_TYPES = ['video/webm', 'video/mp4', 'video/quicktime'].freeze VIDEO_CONVERTIBLE_MIME_TYPES = ['video/webm', 'video/quicktime'].freeze + AUDIO_MIME_TYPES = ['audio/mpeg', 'audio/mp4', 'audio/vnd.wav', 'audio/wav', 'audio/x-wav', 'audio/x-wave', 'audio/ogg',].freeze IMAGE_STYLES = { original: { @@@ -104,9 -86,9 +104,9 @@@ processors: ->(f) { file_processors f }, convert_options: { all: '-quality 90 -strip' } - validates_attachment_content_type :file, content_type: IMAGE_MIME_TYPES + VIDEO_MIME_TYPES + validates_attachment_content_type :file, content_type: IMAGE_MIME_TYPES + VIDEO_MIME_TYPES + AUDIO_MIME_TYPES - validates_attachment_size :file, less_than: IMAGE_LIMIT, unless: :video? - validates_attachment_size :file, less_than: VIDEO_LIMIT, if: :video? + validates_attachment_size :file, less_than: IMAGE_LIMIT, unless: :video_or_gifv? + validates_attachment_size :file, less_than: VIDEO_LIMIT, if: :video_or_gifv? remotable_attachment :file, VIDEO_LIMIT include Attachmentable diff --cc app/services/remove_status_service.rb index 4bee86c8a,2012f15fc..99c8e6cbb --- a/app/services/remove_status_service.rb +++ b/app/services/remove_status_service.rb @@@ -149,18 -153,7 +154,14 @@@ class RemoveStatusService < BaseServic def remove_from_media return unless @status.public_visibility? - Redis.current.publish('timeline:public:media', @payload) - Redis.current.publish('timeline:public:local:media', @payload) if @status.local? + redis.publish('timeline:public:media', @payload) + redis.publish('timeline:public:local:media', @payload) if @status.local? end + + def remove_from_direct + @mentions.each do |mention| + Redis.current.publish("timeline:direct:#{mention.account.id}", @payload) if mention.account.local? + end + Redis.current.publish("timeline:direct:#{@account.id}", @payload) if @account.local? + end - - def redis - Redis.current - end end diff --cc config/locales/en.yml index b8d80a748,dacf16d56..a9553aace --- a/config/locales/en.yml +++ b/config/locales/en.yml @@@ -386,11 -386,8 +386,11 @@@ en desc_html: Modify the look with CSS loaded on every page title: Custom CSS hero: - desc_html: Displayed on the frontpage. At least 600x100px recommended. When not set, falls back to instance thumbnail + desc_html: Displayed on the frontpage. At least 600x100px recommended. When not set, falls back to server thumbnail title: Hero image + hide_followers_count: + desc_html: Do not show followers count on user profiles + title: Hide followers count mascot: desc_html: Displayed on multiple pages. At least 293×205px recommended. When not set, falls back to default mascot title: Mascot image @@@ -805,7 -811,7 +815,8 @@@ development: Development edit_profile: Edit profile export: Data export + featured_tags: Featured hashtags + flavours: Flavours followers: Authorized followers import: Import migrate: Account migration diff --cc config/locales/ja.yml index 2b1b70639,1a2591cb4..e16ce31a9 --- a/config/locales/ja.yml +++ b/config/locales/ja.yml @@@ -801,8 -810,8 +811,9 @@@ ja development: 開発 edit_profile: プロフィールを編集 export: データのエクスポート + featured_tags: 注目のハッシュタグ + flavours: フレーバー - followers: 信頼済みのインスタンス + followers: 信頼済みのサーバー import: データのインポート migrate: アカウントの引っ越し notifications: 通知 diff --cc config/locales/pl.yml index 23fa10179,e110db50d..1567ac626 --- a/config/locales/pl.yml +++ b/config/locales/pl.yml @@@ -826,7 -835,7 +836,8 @@@ pl development: Tworzenie aplikacji edit_profile: Edytuj profil export: Eksportowanie danych + featured_tags: Wyróżnione hashtagi + flavours: Odmiany followers: Autoryzowani śledzący import: Importowanie danych migrate: Migracja konta diff --cc config/locales/simple_form.en.yml index 674abff63,3faaa6ac7..ad9ae7417 --- a/config/locales/simple_form.en.yml +++ b/config/locales/simple_form.en.yml @@@ -34,11 -34,13 +34,13 @@@ 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_theme: Affects how Mastodon looks when you're logged in from any device. + setting_skin: Reskins the selected Mastodon flavour 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: + name: 'You might want to use one of these:' imports: - data: CSV file exported from another Mastodon instance + data: CSV file exported from another Mastodon server sessions: otp: 'Enter the two-factor code generated by your phone app or use one of your recovery codes:' user: diff --cc config/locales/simple_form.pl.yml index 660841e06,0ab045068..f5b5a6ca5 --- a/config/locales/simple_form.pl.yml +++ b/config/locales/simple_form.pl.yml @@@ -33,9 -33,12 +33,12 @@@ pl setting_display_media_show_all: Zawsze pokazuj zawartość multimedialną jako wrażliwą setting_hide_network: Informacje o tym, kto Cię śledzi i kogo śledzisz nie będą widoczne setting_noindex: Wpływa na widoczność strony profilu i Twoich wpisów + setting_show_application: W informacjach o wpisie będzie widoczna informacja o aplikacji, z której został wysłany - setting_theme: Zmienia wygląd Mastodona po zalogowaniu z dowolnego urządzenia. + setting_skin: Zmienia wygląd używanej odmiany Mastodona username: Twoja nazwa użytkownika będzie niepowtarzalna na %{domain} whole_word: Jeśli słowo lub fraza składa się jedynie z liter lub cyfr, filtr będzie zastosowany tylko do pełnych wystąpień + featured_tag: + name: 'Sugerujemy użycie jednego z następujących:' imports: data: Plik CSV wyeksportowany z innej instancji Mastodona sessions: @@@ -102,8 -104,9 +105,9 @@@ setting_hide_network: Ukryj swoją sieć setting_noindex: Nie indeksuj mojego profilu w wyszukiwarkach internetowych setting_reduce_motion: Ogranicz ruch w animacjach + setting_show_application: Informuj o aplikacji z której wysłano wpisy + setting_skin: Motyw setting_system_font_ui: Używaj domyślnej czcionki systemu - setting_theme: Motyw strony setting_unfollow_modal: Pytaj o potwierdzenie przed cofnięciem śledzenia severity: Priorytet type: Importowane dane