diff --git a/app/controllers/api/v1/statuses_controller.rb b/app/controllers/api/v1/statuses_controller.rb index 5814f7c409..e01224deae 100644 --- a/app/controllers/api/v1/statuses_controller.rb +++ b/app/controllers/api/v1/statuses_controller.rb @@ -65,6 +65,7 @@ class Api::V1::StatusesController < Api::BaseController poll: status_params[:poll], content_type: status_params[:content_type], idempotency: request.headers['Idempotency-Key'], + local_only: status_params[:local_only], with_rate_limit: true, quote_id: status_params[:quote_id].presence ) @@ -133,6 +134,7 @@ class Api::V1::StatusesController < Api::BaseController :scheduled_at, :quote_id, :content_type, + :local_only, media_ids: [], media_attributes: [ :id, diff --git a/app/javascript/flavours/glitch/actions/compose.js b/app/javascript/flavours/glitch/actions/compose.js index 017b686934..b47a0aabb9 100644 --- a/app/javascript/flavours/glitch/actions/compose.js +++ b/app/javascript/flavours/glitch/actions/compose.js @@ -197,10 +197,6 @@ export function submitCompose(routerHistory) { return; } - if (getState().getIn(['compose', 'advanced_options', 'do_not_federate'])) { - status = status + ' 👁️'; - } - dispatch(submitComposeRequest()); // If we're editing a post with media attachments, those have not @@ -230,6 +226,7 @@ export function submitCompose(routerHistory) { visibility: getState().getIn(['compose', 'privacy']), poll: getState().getIn(['compose', 'poll'], null), language: getState().getIn(['compose', 'language']), + local_only: getState().getIn(['compose', 'advanced_options', 'do_not_federate']), }, headers: { 'Idempotency-Key': getState().getIn(['compose', 'idempotencyKey']), diff --git a/app/javascript/flavours/glitch/reducers/compose.js b/app/javascript/flavours/glitch/reducers/compose.js index 7fdf5b39cc..dfe0edeadc 100644 --- a/app/javascript/flavours/glitch/reducers/compose.js +++ b/app/javascript/flavours/glitch/reducers/compose.js @@ -206,7 +206,7 @@ function continueThread (state, status) { map.set('in_reply_to', status.id); map.update( 'advanced_options', - map => map.merge(new ImmutableMap({ do_not_federate: status.local_only })) + map => map.merge(new ImmutableMap({ do_not_federate: !!status.local_only })) ); map.set('privacy', status.visibility); map.set('sensitive', false); diff --git a/app/models/status.rb b/app/models/status.rb index ee0eb27b42..19f27df4c3 100644 --- a/app/models/status.rb +++ b/app/models/status.rb @@ -587,8 +587,10 @@ class Status < ApplicationRecord def set_locality if account.domain.nil? && !attribute_changed?(:local_only) - self.local_only = marked_local_only? + self.local_only = true if marked_local_only? end + self.local_only = true if thread&.local_only? && self.local_only.nil? + self.local_only = reblog.local_only if reblog? end def set_conversation diff --git a/app/services/post_status_service.rb b/app/services/post_status_service.rb index 693058ca47..4cb869302b 100644 --- a/app/services/post_status_service.rb +++ b/app/services/post_status_service.rb @@ -183,6 +183,7 @@ class PostStatusService < BaseService content_type: @options[:content_type] || @account.user&.setting_default_content_type, rate_limit: @options[:with_rate_limit], quote_id: @options[:quote_id], + local_only: @options[:local_only], }.compact end