diff --git a/app/services/post_status_service.rb b/app/services/post_status_service.rb index 424f20be5..453e32460 100644 --- a/app/services/post_status_service.rb +++ b/app/services/post_status_service.rb @@ -91,10 +91,11 @@ class PostStatusService < BaseService end end - def local_only_option(local_only, in_reply_to, federation_setting, text) + def local_only_option(local_only, in_reply_to, federation_setting, text, spoiler_text) # This is intended for third party clients. The admin can set a custom :local_only: # emoji that users can append to force a post to be local only. - if text.include? ":local_only:" + if text.include?(':local_only:') || + spoiler_text&.include?(':local_only') return true end if local_only.nil? @@ -189,7 +190,7 @@ class PostStatusService < BaseService language: valid_locale_cascade(@options[:language], @account.user&.preferred_posting_language, I18n.default_locale), application: @options[:application], rate_limit: @options[:with_rate_limit], - local_only: local_only_option(@options[:local_only], @in_reply_to, @account.user&.setting_default_federation, @text), + local_only: local_only_option(@options[:local_only], @in_reply_to, @account.user&.setting_default_federation, @text, @options[:spoiler_text]), }.compact end