Add single_ref_to_quote setting and check ref sync
This commit is contained in:
parent
9db1fb1153
commit
80fadeb766
9 changed files with 38 additions and 2 deletions
|
@ -127,6 +127,10 @@ module HasUserSettings
|
||||||
settings['link_preview']
|
settings['link_preview']
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def setting_single_ref_to_quote
|
||||||
|
settings['single_ref_to_quote']
|
||||||
|
end
|
||||||
|
|
||||||
def setting_dtl_force_with_tag
|
def setting_dtl_force_with_tag
|
||||||
settings['dtl_force_with_tag']&.to_sym || :none
|
settings['dtl_force_with_tag']&.to_sym || :none
|
||||||
end
|
end
|
||||||
|
|
|
@ -41,6 +41,7 @@ class UserSettings
|
||||||
setting :dtl_force_with_tag, default: :none, in: %w(full searchability none)
|
setting :dtl_force_with_tag, default: :none, in: %w(full searchability none)
|
||||||
setting :dtl_force_subscribable, default: false
|
setting :dtl_force_subscribable, default: false
|
||||||
setting :lock_follow_from_bot, default: false
|
setting :lock_follow_from_bot, default: false
|
||||||
|
setting :single_ref_to_quote, default: false
|
||||||
|
|
||||||
setting_inverse_alias :indexable, :noindex
|
setting_inverse_alias :indexable, :noindex
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,10 @@ class ActivityPub::NoteSerializer < ActivityPub::Serializer
|
||||||
attribute :content_map, if: :language?
|
attribute :content_map, if: :language?
|
||||||
attribute :updated, if: :edited?
|
attribute :updated, if: :edited?
|
||||||
|
|
||||||
|
attribute :quote_uri, if: :quote?
|
||||||
|
attribute :misskey_quote, key: :_misskey_quote, if: :quote?
|
||||||
|
attribute :misskey_content, key: :_misskey_content, if: :quote?
|
||||||
|
|
||||||
has_many :virtual_attachments, key: :attachment
|
has_many :virtual_attachments, key: :attachment
|
||||||
has_many :virtual_tags, key: :tag
|
has_many :virtual_tags, key: :tag
|
||||||
|
|
||||||
|
@ -160,6 +164,22 @@ class ActivityPub::NoteSerializer < ActivityPub::Serializer
|
||||||
!object.private_visibility? && !object.direct_visibility? && !object.limited_visibility?
|
!object.private_visibility? && !object.direct_visibility? && !object.limited_visibility?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def quote?
|
||||||
|
object.references.count == 1 && object.account.user&.single_ref_to_quote
|
||||||
|
end
|
||||||
|
|
||||||
|
def quote_uri
|
||||||
|
ActivityPub::TagManager.instance.uri_for(object.references.first)
|
||||||
|
end
|
||||||
|
|
||||||
|
def misskey_quote
|
||||||
|
quote_uri
|
||||||
|
end
|
||||||
|
|
||||||
|
def misskey_content
|
||||||
|
object.text
|
||||||
|
end
|
||||||
|
|
||||||
def poll_options
|
def poll_options
|
||||||
object.preloadable_poll.loaded_options
|
object.preloadable_poll.loaded_options
|
||||||
end
|
end
|
||||||
|
|
|
@ -188,7 +188,7 @@ class PostStatusService < BaseService
|
||||||
|
|
||||||
process_hashtags_service.call(@status)
|
process_hashtags_service.call(@status)
|
||||||
Trends.tags.register(@status)
|
Trends.tags.register(@status)
|
||||||
ProcessReferencesService.perform_worker_async(@status, @reference_ids, [])
|
ProcessReferencesService.call_service(@status, @reference_ids, [])
|
||||||
LinkCrawlWorker.perform_async(@status.id)
|
LinkCrawlWorker.perform_async(@status.id)
|
||||||
DistributionWorker.perform_async(@status.id)
|
DistributionWorker.perform_async(@status.id)
|
||||||
ActivityPub::DistributionWorker.perform_async(@status.id)
|
ActivityPub::DistributionWorker.perform_async(@status.id)
|
||||||
|
|
|
@ -40,6 +40,12 @@ class ProcessReferencesService < BaseService
|
||||||
ProcessReferencesWorker.perform_async(status.id, reference_parameters, urls)
|
ProcessReferencesWorker.perform_async(status.id, reference_parameters, urls)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.call_service(status, reference_parameters, urls)
|
||||||
|
return unless need_process?(status, reference_parameters, urls)
|
||||||
|
|
||||||
|
ProcessReferencesService.new.call(status, reference_parameters || [], urls: urls || [])
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def references
|
def references
|
||||||
|
|
|
@ -162,7 +162,7 @@ class UpdateStatusService < BaseService
|
||||||
def update_references!
|
def update_references!
|
||||||
reference_ids = (@options[:status_reference_ids] || []).map(&:to_i).filter(&:positive?)
|
reference_ids = (@options[:status_reference_ids] || []).map(&:to_i).filter(&:positive?)
|
||||||
|
|
||||||
ProcessReferencesService.perform_worker_async(@status, reference_ids, [])
|
ProcessReferencesService.call_service(@status, reference_ids, [])
|
||||||
end
|
end
|
||||||
|
|
||||||
def update_metadata!
|
def update_metadata!
|
||||||
|
|
|
@ -14,6 +14,9 @@
|
||||||
.fields-group
|
.fields-group
|
||||||
= ff.input :lock_follow_from_bot, wrapper: :with_label, kmyblue: true, label: I18n.t('simple_form.labels.defaults.setting_lock_follow_from_bot')
|
= ff.input :lock_follow_from_bot, wrapper: :with_label, kmyblue: true, label: I18n.t('simple_form.labels.defaults.setting_lock_follow_from_bot')
|
||||||
|
|
||||||
|
.fields-group
|
||||||
|
= ff.input :single_ref_to_quote, wrapper: :with_label, kmyblue: true, label: I18n.t('simple_form.labels.defaults.setting_single_ref_to_quote')
|
||||||
|
|
||||||
%h4= t 'preferences.posting_defaults'
|
%h4= t 'preferences.posting_defaults'
|
||||||
|
|
||||||
.fields-row
|
.fields-row
|
||||||
|
|
|
@ -272,6 +272,7 @@ en:
|
||||||
setting_show_application: Disclose application used to send posts
|
setting_show_application: Disclose application used to send posts
|
||||||
setting_show_emoji_reaction_on_timeline: Show all stamps on timeline
|
setting_show_emoji_reaction_on_timeline: Show all stamps on timeline
|
||||||
setting_simple_timeline_menu: Reduce post menu on timeline
|
setting_simple_timeline_menu: Reduce post menu on timeline
|
||||||
|
setting_single_ref_to_quote: Deliver single reference to other server as quote
|
||||||
setting_stay_privacy: Not change privacy after post
|
setting_stay_privacy: Not change privacy after post
|
||||||
setting_stop_emoji_reaction_streaming: Disable stamp streamings
|
setting_stop_emoji_reaction_streaming: Disable stamp streamings
|
||||||
setting_system_font_ui: Use system's default font
|
setting_system_font_ui: Use system's default font
|
||||||
|
|
|
@ -287,6 +287,7 @@ ja:
|
||||||
setting_show_application: 送信したアプリを開示する
|
setting_show_application: 送信したアプリを開示する
|
||||||
setting_show_emoji_reaction_on_timeline: タイムライン上に他の人のつけたスタンプを表示する
|
setting_show_emoji_reaction_on_timeline: タイムライン上に他の人のつけたスタンプを表示する
|
||||||
setting_simple_timeline_menu: タイムライン上でメニューの項目を減らす
|
setting_simple_timeline_menu: タイムライン上でメニューの項目を減らす
|
||||||
|
setting_single_ref_to_quote: 参照が1つしかない投稿は、他のサーバーには引用として配信する
|
||||||
setting_stay_privacy: 投稿時に公開範囲を保存する
|
setting_stay_privacy: 投稿時に公開範囲を保存する
|
||||||
setting_stop_emoji_reaction_streaming: スタンプのストリーミングを停止する
|
setting_stop_emoji_reaction_streaming: スタンプのストリーミングを停止する
|
||||||
setting_system_font_ui: システムのデフォルトフォントを使う
|
setting_system_font_ui: システムのデフォルトフォントを使う
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue