From ba498ae7798cc35367bece99688e637e6c1609ac Mon Sep 17 00:00:00 2001 From: Claire Date: Tue, 4 Nov 2025 18:58:50 +0100 Subject: [PATCH] Change quote action to error instead of insert link in Private Mentions (#36721) --- app/javascript/mastodon/actions/compose_typed.ts | 6 ++++++ app/javascript/mastodon/locales/en.json | 1 + app/javascript/mastodon/reducers/compose.js | 10 ---------- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/app/javascript/mastodon/actions/compose_typed.ts b/app/javascript/mastodon/actions/compose_typed.ts index 03a973ec0..c7bc4ba0c 100644 --- a/app/javascript/mastodon/actions/compose_typed.ts +++ b/app/javascript/mastodon/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/mastodon/locales/en.json b/app/javascript/mastodon/locales/en.json index 6b4f6dd25..9389299ba 100644 --- a/app/javascript/mastodon/locales/en.json +++ b/app/javascript/mastodon/locales/en.json @@ -764,6 +764,7 @@ "privacy_policy.title": "Privacy Policy", "quote_error.edit": "Quotes cannot be added when editing a post.", "quote_error.poll": "Quoting is not allowed with polls.", + "quote_error.private_mentions": "Quoting is not allowed with direct mentions.", "quote_error.quote": "Only one quote at a time is allowed.", "quote_error.unauthorized": "You are not authorized to quote this post.", "quote_error.upload": "Quoting is not allowed with media attachments.", diff --git a/app/javascript/mastodon/reducers/compose.js b/app/javascript/mastodon/reducers/compose.js index 00db9dd4f..17b9de5fb 100644 --- a/app/javascript/mastodon/reducers/compose.js +++ b/app/javascript/mastodon/reducers/compose.js @@ -345,16 +345,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);