[Glitch] Change quote action to error instead of insert link in Private Mentions

Port 1b795c12e9 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
Claire
2025-11-04 18:58:50 +01:00
parent 58158eba00
commit e24151f688
2 changed files with 6 additions and 10 deletions

View File

@@ -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 (

View File

@@ -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);