From e24151f68886bf07f992c4aff08254553e1d949b Mon Sep 17 00:00:00 2001 From: Claire Date: Tue, 4 Nov 2025 18:58:50 +0100 Subject: [PATCH] [Glitch] Change quote action to error instead of insert link in Private Mentions Port 1b795c12e955eed27d88a31defc78e7b0f93d444 to glitch-soc Signed-off-by: Claire --- .../flavours/glitch/actions/compose_typed.ts | 6 ++++++ app/javascript/flavours/glitch/reducers/compose.js | 10 ---------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/app/javascript/flavours/glitch/actions/compose_typed.ts b/app/javascript/flavours/glitch/actions/compose_typed.ts index e7cefc3fb7..41ac7e9c01 100644 --- a/app/javascript/flavours/glitch/actions/compose_typed.ts +++ b/app/javascript/flavours/glitch/actions/compose_typed.ts @@ -41,6 +41,10 @@ const messages = defineMessages({ id: 'quote_error.unauthorized', defaultMessage: 'You are not authorized to quote this post.', }, + quoteErrorPrivateMention: { + id: 'quote_error.private_mentions', + defaultMessage: 'Quoting is not allowed with direct mentions.', + }, }); type SimulatedMediaAttachmentJSON = ApiMediaAttachmentJSON & { @@ -163,6 +167,8 @@ export const quoteComposeByStatus = createAppThunk( if (composeState.get('id')) { dispatch(showAlert({ message: messages.quoteErrorEdit })); + } else if (composeState.get('privacy') === 'direct') { + dispatch(showAlert({ message: messages.quoteErrorPrivateMention })); } else if (composeState.get('poll')) { dispatch(showAlert({ message: messages.quoteErrorPoll })); } else if ( diff --git a/app/javascript/flavours/glitch/reducers/compose.js b/app/javascript/flavours/glitch/reducers/compose.js index 6e7dd143fd..aca48e8824 100644 --- a/app/javascript/flavours/glitch/reducers/compose.js +++ b/app/javascript/flavours/glitch/reducers/compose.js @@ -421,16 +421,6 @@ export const composeReducer = (state = initialState, action) => { return 'private'; } return visibility; - }) - .update('text', (text) => { - if (!isDirect) { - return text; - } - const url = status.get('url'); - if (text.includes(url)) { - return text; - } - return text.trim() ? `${text}\n\n${url}` : url; }); } else if (quoteComposeCancel.match(action)) { return state.set('quoted_status_id', null);