From 8b75cc93f1f9f85cdb0f47f1f859fc467bd02a28 Mon Sep 17 00:00:00 2001 From: Darius Kazemi Date: Sat, 16 May 2020 13:43:05 -0700 Subject: [PATCH] Adding sensible federation default for third party clients Fixes #48. --- app/services/post_status_service.rb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/services/post_status_service.rb b/app/services/post_status_service.rb index c810eb331..61bcdd11b 100644 --- a/app/services/post_status_service.rb +++ b/app/services/post_status_service.rb @@ -88,8 +88,15 @@ class PostStatusService < BaseService end def local_only_option(local_only, in_reply_to, federation_setting) - return in_reply_to&.local_only? if local_only.nil? # XXX temporary, just until clients implement to avoid leaking local_only posts - return federation_setting if local_only.nil? + if local_only.nil? + if in_reply_to&.local_only? + return true + end + if !in_reply_to&.local_only? + return false + end + return !federation_setting + end local_only end