Merge remote-tracking branch 'claire/glitch-soc/features/redesign-localonly-toots' into th-downstream

th-downstream
Skye 9 months ago
commit 415c5eb2d4
Signed by: me
GPG Key ID: 0104BC05F41B77B8

@ -70,7 +70,8 @@ class Api::V1::StatusesController < Api::BaseController
allowed_mentions: status_params[:allowed_mentions],
idempotency: request.headers['Idempotency-Key'],
with_rate_limit: true,
quote_id: status_params[:quote_id].presence
quote_id: status_params[:quote_id].presence,
local_only: status_params[:local_only])
)
render json: @status, serializer: @status.is_a?(ScheduledStatus) ? REST::ScheduledStatusSerializer : REST::StatusSerializer
@ -144,6 +145,7 @@ class Api::V1::StatusesController < Api::BaseController
:quote_id,
:content_type,
allowed_mentions: [],
:local_only,
media_ids: [],
media_attributes: [
:id,

@ -213,10 +213,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
@ -254,6 +250,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']),

@ -208,7 +208,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);

@ -564,7 +564,9 @@ class Status < ApplicationRecord
def set_local_only
return unless account.domain.nil? && !attribute_changed?(:local_only)
self.local_only = marked_local_only?
self.local_only = true if marked_local_only?
self.local_only = true if thread&.local_only? && self.local_only.nil?
self.local_only = reblog.local_only if reblog?
end
def set_conversation

@ -212,6 +212,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

Loading…
Cancel
Save