Change: #398 管理者設定:スタンプのストリーミングを有効にする設定→ローカルユーザーの絡むスタンプのストリーミングを有効にする (#414)

This commit is contained in:
KMY(雪あすか) 2024-01-04 08:35:47 +09:00 committed by GitHub
parent 37bc3c6171
commit 5d8a9f4757
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 12 additions and 14 deletions

View file

@ -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)

View file

@ -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)

View file

@ -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

View file

@ -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

View file

@ -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)

View file

@ -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