mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-05-08 08:58:38 +01:00
Remove invalid quotes from conversation
This commit is contained in:
@@ -733,19 +733,20 @@ export function setQuoteByMessageId(
|
|||||||
|
|
||||||
const message = messageId ? await getMessageById(messageId) : undefined;
|
const message = messageId ? await getMessageById(messageId) : undefined;
|
||||||
const state = getState();
|
const state = getState();
|
||||||
|
|
||||||
if (
|
if (
|
||||||
message &&
|
!message ||
|
||||||
|
!isNormalBubble(message.attributes) ||
|
||||||
!canReply(
|
!canReply(
|
||||||
message.attributes,
|
message.attributes,
|
||||||
window.ConversationController.getOurConversationIdOrThrow(),
|
window.ConversationController.getOurConversationIdOrThrow(),
|
||||||
getConversationSelector(state)
|
getConversationSelector(state)
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
return;
|
dispatch(setQuotedMessage(conversationId, undefined));
|
||||||
}
|
conversation.set({
|
||||||
|
quotedMessageId: undefined,
|
||||||
if (message && !isNormalBubble(message.attributes)) {
|
});
|
||||||
|
await DataWriter.updateConversation(conversation.attributes);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -770,7 +771,6 @@ export function setQuoteByMessageId(
|
|||||||
await DataWriter.updateConversation(conversation.attributes);
|
await DataWriter.updateConversation(conversation.attributes);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (message) {
|
|
||||||
const quote = await makeQuote(message.attributes);
|
const quote = await makeQuote(message.attributes);
|
||||||
|
|
||||||
// In case the conversation changed while we were about to set the quote
|
// In case the conversation changed while we were about to set the quote
|
||||||
@@ -786,9 +786,6 @@ export function setQuoteByMessageId(
|
|||||||
);
|
);
|
||||||
|
|
||||||
dispatch(setComposerFocus(conversation.id));
|
dispatch(setComposerFocus(conversation.id));
|
||||||
} else {
|
|
||||||
dispatch(setQuotedMessage(conversationId, undefined));
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user