From 5d8a9f4757b81311e177c3aadc6489afff8217c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?KMY=EF=BC=88=E9=9B=AA=E3=81=82=E3=81=99=E3=81=8B=EF=BC=89?= Date: Thu, 4 Jan 2024 08:35:47 +0900 Subject: [PATCH] =?UTF-8?q?Change:=20#398=20=E7=AE=A1=E7=90=86=E8=80=85?= =?UTF-8?q?=E8=A8=AD=E5=AE=9A=EF=BC=9A=E3=82=B9=E3=82=BF=E3=83=B3=E3=83=97?= =?UTF-8?q?=E3=81=AE=E3=82=B9=E3=83=88=E3=83=AA=E3=83=BC=E3=83=9F=E3=83=B3?= =?UTF-8?q?=E3=82=B0=E3=82=92=E6=9C=89=E5=8A=B9=E3=81=AB=E3=81=99=E3=82=8B?= =?UTF-8?q?=E8=A8=AD=E5=AE=9A=E2=86=92=E3=83=AD=E3=83=BC=E3=82=AB=E3=83=AB?= =?UTF-8?q?=E3=83=A6=E3=83=BC=E3=82=B6=E3=83=BC=E3=81=AE=E7=B5=A1=E3=82=80?= =?UTF-8?q?=E3=82=B9=E3=82=BF=E3=83=B3=E3=83=97=E3=81=AE=E3=82=B9=E3=83=88?= =?UTF-8?q?=E3=83=AA=E3=83=BC=E3=83=9F=E3=83=B3=E3=82=B0=E3=82=92=E6=9C=89?= =?UTF-8?q?=E5=8A=B9=E3=81=AB=E3=81=99=E3=82=8B=20(#414)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/lib/activitypub/activity/like.rb | 2 +- app/lib/activitypub/activity/undo.rb | 2 +- app/models/form/admin_settings.rb | 4 ++-- app/services/emoji_react_service.rb | 2 +- app/services/un_emoji_react_service.rb | 2 +- app/views/admin/settings/discovery/show.html.haml | 2 +- config/locales/simple_form.en.yml | 5 ++--- config/locales/simple_form.ja.yml | 5 ++--- config/settings.yml | 2 +- 9 files changed, 12 insertions(+), 14 deletions(-) diff --git a/app/lib/activitypub/activity/like.rb b/app/lib/activitypub/activity/like.rb index 9249e522d9..70398ce1be 100644 --- a/app/lib/activitypub/activity/like.rb +++ b/app/lib/activitypub/activity/like.rb @@ -156,7 +156,7 @@ class ActivityPub::Activity::Like < ActivityPub::Activity emoji_group = @original_status.emoji_reactions_grouped_by_name(nil, force: true) .find { |reaction_group| reaction_group['name'] == emoji_reaction.name && (!reaction_group.key?(:domain) || reaction_group['domain'] == emoji_reaction.custom_emoji&.domain) } emoji_group['status_id'] = @original_status.id.to_s - DeliveryEmojiReactionWorker.perform_async(render_emoji_reaction(emoji_group), @original_status.id, emoji_reaction.account_id) if Setting.streaming_emoji_reaction && (@original_status.local? || Setting.streaming_other_servers_emoji_reaction) + DeliveryEmojiReactionWorker.perform_async(render_emoji_reaction(emoji_group), @original_status.id, emoji_reaction.account_id) if @original_status.local? ? Setting.streaming_local_emoji_reaction : Setting.streaming_other_servers_emoji_reaction end def render_emoji_reaction(emoji_group) diff --git a/app/lib/activitypub/activity/undo.rb b/app/lib/activitypub/activity/undo.rb index b7c716079d..9827f9310f 100644 --- a/app/lib/activitypub/activity/undo.rb +++ b/app/lib/activitypub/activity/undo.rb @@ -163,7 +163,7 @@ class ActivityPub::Activity::Undo < ActivityPub::Activity emoji_group = { 'name' => emoji_reaction.name, 'count' => 0, 'account_ids' => [], 'status_id' => @original_status.id.to_s } emoji_group['domain'] = emoji_reaction.custom_emoji.domain if emoji_reaction.custom_emoji end - DeliveryEmojiReactionWorker.perform_async(render_emoji_reaction(emoji_group), @original_status.id, emoji_reaction.account_id) if Setting.streaming_emoji_reaction && (@original_status.local? || Setting.streaming_other_servers_emoji_reaction) + DeliveryEmojiReactionWorker.perform_async(render_emoji_reaction(emoji_group), @original_status.id, emoji_reaction.account_id) if @original_status.local? ? Setting.streaming_local_emoji_reaction : Setting.streaming_other_servers_emoji_reaction end def render_emoji_reaction(emoji_group) diff --git a/app/models/form/admin_settings.rb b/app/models/form/admin_settings.rb index f4db9a0325..2231695b77 100644 --- a/app/models/form/admin_settings.rb +++ b/app/models/form/admin_settings.rb @@ -47,7 +47,7 @@ class Form::AdminSettings authorized_fetch receive_other_servers_emoji_reaction streaming_other_servers_emoji_reaction - streaming_emoji_reaction + streaming_local_emoji_reaction enable_emoji_reaction check_lts_version_only enable_public_unlisted_visibility @@ -79,7 +79,7 @@ class Form::AdminSettings authorized_fetch receive_other_servers_emoji_reaction streaming_other_servers_emoji_reaction - streaming_emoji_reaction + streaming_local_emoji_reaction enable_emoji_reaction check_lts_version_only enable_public_unlisted_visibility diff --git a/app/services/emoji_react_service.rb b/app/services/emoji_react_service.rb index ba56cff623..9099c8391b 100644 --- a/app/services/emoji_react_service.rb +++ b/app/services/emoji_react_service.rb @@ -37,7 +37,7 @@ class EmojiReactService < BaseService create_notification notify_to_followers increment_statistics - write_stream! if Setting.streaming_emoji_reaction + write_stream! if Setting.streaming_local_emoji_reaction @emoji_reaction end diff --git a/app/services/un_emoji_react_service.rb b/app/services/un_emoji_react_service.rb index 0d283644a3..7d9b61df7b 100644 --- a/app/services/un_emoji_react_service.rb +++ b/app/services/un_emoji_react_service.rb @@ -15,7 +15,7 @@ class UnEmojiReactService < BaseService create_notification(emoji_reaction) if !@status.account.local? && @status.account.activitypub? notify_to_followers(emoji_reaction) - write_stream(emoji_reaction) if Setting.streaming_emoji_reaction + write_stream(emoji_reaction) if Setting.streaming_local_emoji_reaction relay_for_undo_emoji_reaction!(emoji_reaction) relay_friend_for_undo_emoji_reaction!(emoji_reaction) diff --git a/app/views/admin/settings/discovery/show.html.haml b/app/views/admin/settings/discovery/show.html.haml index ab1319e791..c4d0fd3354 100644 --- a/app/views/admin/settings/discovery/show.html.haml +++ b/app/views/admin/settings/discovery/show.html.haml @@ -35,7 +35,7 @@ = f.input :enable_emoji_reaction, as: :boolean, wrapper: :with_label, kmyblue: true, hint: false .fields-group - = f.input :streaming_emoji_reaction, as: :boolean, wrapper: :with_label, kmyblue: true + = f.input :streaming_local_emoji_reaction, as: :boolean, wrapper: :with_label, kmyblue: true .fields-group = f.input :receive_other_servers_emoji_reaction, as: :boolean, wrapper: :with_label, kmyblue: true diff --git a/config/locales/simple_form.en.yml b/config/locales/simple_form.en.yml index 076f6d293d..4f1333c713 100644 --- a/config/locales/simple_form.en.yml +++ b/config/locales/simple_form.en.yml @@ -113,8 +113,7 @@ en: site_terms: Use your own privacy policy or leave blank to use the default. Can be structured with Markdown syntax. site_title: How people may refer to your server besides its domain name. status_page_url: URL of a page where people can see the status of this server during an outage - streaming_emoji_reaction: If the server load is high, try unchecking the box temporarily. - streaming_other_servers_emoji_reaction: Check network lines and server load as large amounts of data are delivered. + streaming_other_servers_emoji_reaction: Check network lines and server load as large amounts of data are delivered. If the server load is high, try unchecking the box temporarily. theme: Theme that logged out visitors and new users see. thumbnail: A roughly 2:1 image displayed alongside your server information. timeline_preview: Logged out visitors will be able to browse the most recent public posts available on the server. @@ -363,7 +362,7 @@ en: site_terms: Privacy Policy site_title: Server name status_page_url: Status page URL - streaming_emoji_reaction: Enable stamp streaming + streaming_local_emoji_reaction: Streaming stamp related to local users streaming_other_servers_emoji_reaction: Streaming stamp between other server users theme: Default theme thumbnail: Server thumbnail diff --git a/config/locales/simple_form.ja.yml b/config/locales/simple_form.ja.yml index bdd15a2783..b8fb1ecbff 100644 --- a/config/locales/simple_form.ja.yml +++ b/config/locales/simple_form.ja.yml @@ -125,8 +125,7 @@ ja: site_terms: 独自のプライバシーポリシーを使用するか空白にしてデフォルトのプライバシーポリシーを使用します。Markdownが使えます。 site_title: ドメイン名以外でサーバーを参照する方法 status_page_url: 障害発生時などにユーザーがサーバーの状態を確認できるページのURL - streaming_emoji_reaction: サーバーの負荷が高い場合は一時的にチェックを外してみてください。 - streaming_other_servers_emoji_reaction: 大量のデータが配信されるため、ネットワークの回線やサーバーの負荷をチェックしてください。 + streaming_other_servers_emoji_reaction: 大量のデータが配信されるため、ネットワークの回線やサーバーの負荷をチェックしてください。サーバーの負荷が高い場合は一時的にチェックを外してみてください。 theme: ログインしていない人と新規ユーザーに表示されるテーマ。 thumbnail: サーバー情報と共に表示される、アスペクト比が約 2:1 の画像。 timeline_preview: ログインしていないユーザーがサーバー上の最新の公開投稿を閲覧できるようにします。 @@ -373,7 +372,7 @@ ja: site_terms: プライバシーポリシー site_title: サーバーの名前 status_page_url: サーバーの状態ページのURL - streaming_emoji_reaction: スタンプのストリーミングを有効にする + streaming_local_emoji_reaction: ローカルユーザーがつけた、またはローカル投稿についたスタンプをストリーミングする streaming_other_servers_emoji_reaction: 他のサーバーのユーザーが他のサーバーの投稿につけたスタンプをストリーミングする theme: デフォルトテーマ thumbnail: サーバーのサムネイル diff --git a/config/settings.yml b/config/settings.yml index 3997e3d354..62280dd60f 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -40,7 +40,7 @@ defaults: &defaults captcha_enabled: false receive_other_servers_emoji_reaction: false streaming_other_servers_emoji_reaction: false - streaming_emoji_reaction: true + streaming_local_emoji_reaction: true enable_emoji_reaction: true check_lts_version_only: true enable_public_unlisted_visibility: true