diff --git a/app/lib/activitypub/activity/like.rb b/app/lib/activitypub/activity/like.rb index c18d042438..40323ea710 100644 --- a/app/lib/activitypub/activity/like.rb +++ b/app/lib/activitypub/activity/like.rb @@ -7,7 +7,7 @@ class ActivityPub::Activity::Like < ActivityPub::Activity def perform @original_status = status_from_uri(object_uri) - return if @original_status.nil? || !@original_status.account.local? || delete_arrived_first?(@json['id']) || reject_favourite? + return if @original_status.nil? || delete_arrived_first?(@json['id']) || reject_favourite? if shortcode.nil? process_favourite @@ -32,6 +32,8 @@ class ActivityPub::Activity::Like < ActivityPub::Activity end def process_emoji_reaction + return if !@original_status.account.local? && !Setting.receive_other_servers_emoji_reaction + if emoji_tag.present? return if emoji_tag['id'].blank? || emoji_tag['name'].blank? || emoji_tag['icon'].blank? || emoji_tag['icon']['url'].blank? diff --git a/app/models/form/admin_settings.rb b/app/models/form/admin_settings.rb index c133f17124..a43ceb837e 100644 --- a/app/models/form/admin_settings.rb +++ b/app/models/form/admin_settings.rb @@ -42,6 +42,7 @@ class Form::AdminSettings sensitive_words sensitive_words_for_full authorized_fetch + receive_other_servers_emoji_reaction ).freeze INTEGER_KEYS = %i( @@ -65,6 +66,7 @@ class Form::AdminSettings captcha_enabled hide_local_users_for_anonymous authorized_fetch + receive_other_servers_emoji_reaction ).freeze UPLOAD_KEYS = %i( diff --git a/app/views/admin/settings/discovery/show.html.haml b/app/views/admin/settings/discovery/show.html.haml index 62011d5c56..0f4357c2db 100644 --- a/app/views/admin/settings/discovery/show.html.haml +++ b/app/views/admin/settings/discovery/show.html.haml @@ -29,6 +29,9 @@ .fields-group = f.input :noindex, as: :boolean, wrapper: :with_label, label: t('admin.settings.default_noindex.title'), hint: t('admin.settings.default_noindex.desc_html') + .fields-group + = f.input :receive_other_servers_emoji_reaction, as: :boolean, wrapper: :with_label, kmyblue: true + %h4= t('admin.settings.discovery.publish_statistics') .fields-group diff --git a/config/locales/simple_form.en.yml b/config/locales/simple_form.en.yml index df3f8cae35..93c6f47a48 100644 --- a/config/locales/simple_form.en.yml +++ b/config/locales/simple_form.en.yml @@ -98,6 +98,7 @@ en: media_cache_retention_period: Downloaded media files will be deleted after the specified number of days when set to a positive value, and re-downloaded on demand. peers_api_enabled: A list of domain names this server has encountered in the fediverse. No data is included here about whether you federate with a given server, just that your server knows about it. This is used by services that collect statistics on federation in a general sense. profile_directory: The profile directory lists all users who have opted-in to be discoverable. + receive_other_servers_emoji_reaction: It can cause load. It is recommended to enable it only when there are few people. require_invite_text: When sign-ups require manual approval, make the “Why do you want to join?” text input mandatory rather than optional site_contact_email: How people can reach you for legal or support inquiries. site_contact_username: How people can reach you on Mastodon. @@ -317,6 +318,7 @@ en: media_cache_retention_period: Media cache retention period peers_api_enabled: Publish list of discovered servers in the API profile_directory: Enable profile directory + receive_other_servers_emoji_reaction: Receive stamp between other server users registrations_mode: Who can sign-up require_invite_text: Require a reason to join show_domain_blocks: Show domain blocks diff --git a/config/locales/simple_form.ja.yml b/config/locales/simple_form.ja.yml index cd94988c4e..def4e311c5 100644 --- a/config/locales/simple_form.ja.yml +++ b/config/locales/simple_form.ja.yml @@ -108,6 +108,7 @@ ja: media_cache_retention_period: 正の値に設定されている場合、ダウンロードされたメディアファイルは指定された日数の後に削除され、リクエストに応じて再ダウンロードされます。 peers_api_enabled: このサーバーが Fediverse で遭遇したドメイン名のリストです。このサーバーが知っているだけで、特定のサーバーと連合しているかのデータは含まれません。これは一般的に Fediverse に関する統計情報を収集するサービスによって使用されます。 profile_directory: ディレクトリには、掲載する設定をしたすべてのユーザーが一覧表示されます。 + receive_other_servers_emoji_reaction: 負荷の原因になります。人が少ない場合にのみ有効にすることをおすすめします。 require_invite_text: アカウント登録が承認制の場合、登録の際の申請事由の入力を必須にします site_contact_email: 法律またはサポートに関する問い合わせ先 site_contact_username: マストドンでの連絡方法 @@ -328,6 +329,7 @@ ja: media_cache_retention_period: メディアキャッシュの保持期間 peers_api_enabled: 発見したサーバーのリストをAPIで公開する profile_directory: ディレクトリを有効にする + receive_other_servers_emoji_reaction: 他のサーバーのユーザーが他のサーバーの投稿につけたスタンプを受け入れる registrations_mode: 新規登録が可能な人 require_invite_text: 申請事由の入力を必須にする show_domain_blocks: ドメインブロックを表示 diff --git a/config/settings.yml b/config/settings.yml index 67297c26ce..a9c4313164 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -38,6 +38,7 @@ defaults: &defaults require_invite_text: false backups_retention_period: 7 captcha_enabled: false + receive_other_servers_emoji_reaction: false development: <<: *defaults