Fix out-of-order applications of reaction and delete-for-everyone
This commit is contained in:
parent
05f905fd10
commit
e8759fc81b
3 changed files with 14 additions and 12 deletions
|
@ -3344,16 +3344,18 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
|
|||
|
||||
// Does this message have any pending, previously-received associated reactions?
|
||||
const reactions = window.Whisper.Reactions.forMessage(message);
|
||||
reactions.forEach(reaction => {
|
||||
message.handleReaction(reaction, false);
|
||||
});
|
||||
await Promise.all(
|
||||
reactions.map(reaction => message.handleReaction(reaction, false))
|
||||
);
|
||||
|
||||
// Does this message have any pending, previously-received associated
|
||||
// delete for everyone messages?
|
||||
const deletes = window.Whisper.Deletes.forMessage(message);
|
||||
deletes.forEach(del => {
|
||||
window.Signal.Util.deleteForEveryone(message, del, false);
|
||||
});
|
||||
await Promise.all(
|
||||
deletes.map(del =>
|
||||
window.Signal.Util.deleteForEveryone(message, del, false)
|
||||
)
|
||||
);
|
||||
|
||||
await window.Signal.Data.saveMessage(message.attributes, {
|
||||
Message: window.Whisper.Message,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue