Change quote action to error instead of insert link in Private Mentions (#36721)
This commit is contained in:
@@ -41,6 +41,10 @@ const messages = defineMessages({
|
|||||||
id: 'quote_error.unauthorized',
|
id: 'quote_error.unauthorized',
|
||||||
defaultMessage: 'You are not authorized to quote this post.',
|
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 & {
|
type SimulatedMediaAttachmentJSON = ApiMediaAttachmentJSON & {
|
||||||
@@ -163,6 +167,8 @@ export const quoteComposeByStatus = createAppThunk(
|
|||||||
|
|
||||||
if (composeState.get('id')) {
|
if (composeState.get('id')) {
|
||||||
dispatch(showAlert({ message: messages.quoteErrorEdit }));
|
dispatch(showAlert({ message: messages.quoteErrorEdit }));
|
||||||
|
} else if (composeState.get('privacy') === 'direct') {
|
||||||
|
dispatch(showAlert({ message: messages.quoteErrorPrivateMention }));
|
||||||
} else if (composeState.get('poll')) {
|
} else if (composeState.get('poll')) {
|
||||||
dispatch(showAlert({ message: messages.quoteErrorPoll }));
|
dispatch(showAlert({ message: messages.quoteErrorPoll }));
|
||||||
} else if (
|
} else if (
|
||||||
|
|||||||
@@ -764,6 +764,7 @@
|
|||||||
"privacy_policy.title": "Privacy Policy",
|
"privacy_policy.title": "Privacy Policy",
|
||||||
"quote_error.edit": "Quotes cannot be added when editing a post.",
|
"quote_error.edit": "Quotes cannot be added when editing a post.",
|
||||||
"quote_error.poll": "Quoting is not allowed with polls.",
|
"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.quote": "Only one quote at a time is allowed.",
|
||||||
"quote_error.unauthorized": "You are not authorized to quote this post.",
|
"quote_error.unauthorized": "You are not authorized to quote this post.",
|
||||||
"quote_error.upload": "Quoting is not allowed with media attachments.",
|
"quote_error.upload": "Quoting is not allowed with media attachments.",
|
||||||
|
|||||||
@@ -345,16 +345,6 @@ export const composeReducer = (state = initialState, action) => {
|
|||||||
return 'private';
|
return 'private';
|
||||||
}
|
}
|
||||||
return visibility;
|
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)) {
|
} else if (quoteComposeCancel.match(action)) {
|
||||||
return state.set('quoted_status_id', null);
|
return state.set('quoted_status_id', null);
|
||||||
|
|||||||
Reference in New Issue
Block a user