Only validate replies on stories from self

This commit is contained in:
Alvaro 2022-11-28 17:53:43 -07:00 committed by GitHub
parent a8ce959405
commit 5b6c624803
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2552,7 +2552,11 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
storyQuote.get('sendStateByConversationId') || {};
const sendState = sendStateByConversationId[sender.id];
if (!sendState) {
const storyQuoteIsFromSelf =
storyQuote.get('sourceUuid') ===
window.storage.user.getCheckedUuid().toString();
if (storyQuoteIsFromSelf && !sendState) {
log.warn(
`${idLog}: Received storyContext message but sender was not in sendStateByConversationId. Dropping.`
);
@ -2561,7 +2565,10 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
return;
}
if (sendState.isAllowedToReplyToStory === false) {
if (
storyQuoteIsFromSelf &&
sendState.isAllowedToReplyToStory === false
) {
log.warn(
`${idLog}: Received storyContext message but sender is not allowed to reply. Dropping.`
);