diff --git a/app/javascript/mastodon/components/status.jsx b/app/javascript/mastodon/components/status.jsx index a9970ad263..274ff80f35 100644 --- a/app/javascript/mastodon/components/status.jsx +++ b/app/javascript/mastodon/components/status.jsx @@ -18,7 +18,7 @@ import Card from '../features/status/components/card'; // to use the progress bar to show download progress import Bundle from '../features/ui/components/bundle'; import { MediaGallery, Video, Audio } from '../features/ui/util/async-components'; -import { displayMedia, enableEmojiReaction } from '../initial_state'; +import { displayMedia, enableEmojiReaction, showEmojiReactionOnTimeline } from '../initial_state'; import { Avatar } from './avatar'; import { AvatarOverlay } from './avatar_overlay'; @@ -577,8 +577,7 @@ class Status extends ImmutablePureComponent { let emojiReactionsBar = null; if (!this.props.withoutEmojiReactions && status.get('emoji_reactions')) { const emojiReactions = status.get('emoji_reactions'); - const emojiReactionPolicy = status.getIn(['account', 'other_settings', 'emoji_reaction_policy']) || 'allow'; - if (emojiReactions.size > 0 && enableEmojiReaction && emojiReactionPolicy !== 'block_and_hide') { + if (emojiReactions.size > 0 && enableEmojiReaction && showEmojiReactionOnTimeline) { emojiReactionsBar = ; } } diff --git a/app/javascript/mastodon/initial_state.js b/app/javascript/mastodon/initial_state.js index e560e1bbca..8b2a0df69b 100644 --- a/app/javascript/mastodon/initial_state.js +++ b/app/javascript/mastodon/initial_state.js @@ -76,6 +76,7 @@ * @property {string} repository * @property {boolean} search_enabled * @property {boolean} trends_enabled + * @property {boolean} show_emoji_reaction_on_timeline * @property {boolean} single_user_mode * @property {string} source_url * @property {string} streaming_api_base_url @@ -144,6 +145,7 @@ export const registrationsOpen = getMeta('registrations_open'); export const repository = getMeta('repository'); export const searchEnabled = getMeta('search_enabled'); export const trendsEnabled = getMeta('trends_enabled'); +export const showEmojiReactionOnTimeline = getMeta('show_emoji_reaction_on_timeline'); export const showTrends = getMeta('show_trends'); export const singleUserMode = getMeta('single_user_mode'); export const source_url = getMeta('source_url'); diff --git a/app/models/concerns/has_user_settings.rb b/app/models/concerns/has_user_settings.rb index 00ddfde6dd..8a5e1a0b12 100644 --- a/app/models/concerns/has_user_settings.rb +++ b/app/models/concerns/has_user_settings.rb @@ -47,6 +47,10 @@ module HasUserSettings settings['web.enable_emoji_reaction'] end + def setting_show_emoji_reaction_on_timeline + settings['web.show_emoji_reaction_on_timeline'] + end + def setting_default_sensitive settings['default_sensitive'] end diff --git a/app/models/user_settings.rb b/app/models/user_settings.rb index f275cb6904..141c6c77dc 100644 --- a/app/models/user_settings.rb +++ b/app/models/user_settings.rb @@ -56,6 +56,7 @@ class UserSettings setting :enable_dtl_menu, default: false setting :hide_recent_emojis, default: false setting :enable_emoji_reaction, default: true + setting :show_emoji_reaction_on_timeline, default: true setting :reblog_modal, default: false setting :unfollow_modal, default: true setting :reduce_motion, default: false diff --git a/app/serializers/initial_state_serializer.rb b/app/serializers/initial_state_serializer.rb index de8192e277..8f1dadec76 100644 --- a/app/serializers/initial_state_serializer.rb +++ b/app/serializers/initial_state_serializer.rb @@ -49,6 +49,7 @@ class InitialStateSerializer < ActiveModel::Serializer store[:display_media_expand] = object.current_account.user.setting_display_media_expand store[:expand_spoilers] = object.current_account.user.setting_expand_spoilers store[:enable_emoji_reaction] = object.current_account.user.setting_enable_emoji_reaction + store[:show_emoji_reaction_on_timeline] = object.current_account.user.setting_show_emoji_reaction_on_timeline store[:enable_login_privacy] = object.current_account.user.setting_enable_login_privacy store[:enable_dtl_menu] = object.current_account.user.setting_enable_dtl_menu store[:hide_recent_emojis] = object.current_account.user.setting_hide_recent_emojis diff --git a/app/views/settings/preferences/appearance/show.html.haml b/app/views/settings/preferences/appearance/show.html.haml index 71313c5232..95ba554c71 100644 --- a/app/views/settings/preferences/appearance/show.html.haml +++ b/app/views/settings/preferences/appearance/show.html.haml @@ -40,6 +40,7 @@ .fields-group = ff.input :'web.hide_recent_emojis', wrapper: :with_label, kmyblue: true, label: I18n.t('simple_form.labels.defaults.setting_hide_recent_emojis'), hint: false = ff.input :'web.enable_emoji_reaction', wrapper: :with_label, kmyblue: true, label: I18n.t('simple_form.labels.defaults.setting_enable_emoji_reaction'), hint: I18n.t('simple_form.hints.defaults.setting_enable_emoji_reaction') + = ff.input :'web.show_emoji_reaction_on_timeline', wrapper: :with_label, kmyblue: true, label: I18n.t('simple_form.labels.defaults.setting_show_emoji_reaction_on_timeline') .fields-group = ff.input :'web.bookmark_category_needed', wrapper: :with_label, kmyblue: true, label: I18n.t('simple_form.labels.defaults.setting_bookmark_category_needed'), hint: I18n.t('simple_form.hints.defaults.setting_bookmark_category_needed') diff --git a/config/locales/simple_form.en.yml b/config/locales/simple_form.en.yml index 626b25bb03..0be556c451 100644 --- a/config/locales/simple_form.en.yml +++ b/config/locales/simple_form.en.yml @@ -242,7 +242,7 @@ en: setting_dtl_force_subscribable: Ignore your dissubscribable setting when using the DTL tag setting_dtl_force_with_tag: Post with DTL tag setting_emoji_reaction_streaming_notify_impl2: Enable stamp notification compat with Nyastodon, Catstodon, glitch-soc - setting_enable_emoji_reaction: Show emoji reaction on your display + setting_enable_emoji_reaction: Use stamp function setting_enable_login_privacy: Enable login visibility setting_emoji_reaction_policy: Stamp receive/display policy setting_emoji_reaction_policy_items: @@ -267,6 +267,7 @@ en: setting_reject_unlisted_subscription: Reject sending unlisted posts to Misskey, Calckey setting_send_without_domain_blocks: Send your post to all server with administrator set as rejecting-post-server for protect you [DEPRECATED] setting_show_application: Disclose application used to send posts + setting_show_emoji_reaction_on_timeline: Show stamps on timeline setting_stay_privacy: Not change privacy after post setting_stop_emoji_reaction_streaming: Disable stamp streamings setting_system_font_ui: Use system's default font diff --git a/config/locales/simple_form.ja.yml b/config/locales/simple_form.ja.yml index 78d89a2a9e..c5f9ad84c9 100644 --- a/config/locales/simple_form.ja.yml +++ b/config/locales/simple_form.ja.yml @@ -262,7 +262,7 @@ ja: mutuals_only: 相互のみ許可 outside_only: フォロー中、またはフォロワーのみに許可 setting_emoji_reaction_streaming_notify_impl2: Nyastodon, Catstodon, glitch-soc互換のスタンプ機能を有効にする - setting_enable_emoji_reaction: 自分の画面に絵文字リアクションを表示する + setting_enable_emoji_reaction: スタンプ機能を使用する setting_expand_spoilers: 閲覧注意としてマークされた投稿を常に展開する setting_hide_followers_count: フォロワー数を隠す setting_hide_following_count: フォロー数を隠す @@ -278,6 +278,7 @@ ja: setting_reject_unlisted_subscription: Misskey系サーバーに「未収載」投稿を「フォロワーのみ」に変換して配送する setting_send_without_domain_blocks: 管理人の設定した配送停止設定を拒否する (非推奨) setting_show_application: 送信したアプリを開示する + setting_show_emoji_reaction_on_timeline: タイムライン上にスタンプを表示する setting_stay_privacy: 投稿時に公開範囲を保存する setting_stop_emoji_reaction_streaming: スタンプのストリーミングを停止する setting_system_font_ui: システムのデフォルトフォントを使う