1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-12-05 17:02:07 +03:00

first look in pending event list for event being redacted

in case the redacted event hasn't been sent yet
This commit is contained in:
Bruno Windels
2019-06-07 15:45:00 +02:00
parent c58db665dd
commit 6eb229ac1e

View File

@@ -1143,7 +1143,10 @@ Room.prototype.addPendingEvent = function(event, txnId) {
if (event.getType() === "m.room.redaction") { if (event.getType() === "m.room.redaction") {
const redactId = event.event.redacts; const redactId = event.event.redacts;
const redactedEvent = this.getUnfilteredTimelineSet().findEventById(redactId); let redactedEvent = this._pendingEventList && this._pendingEventList.find(e => e.getId() === redactId);
if (!redactedEvent) {
redactedEvent = this.getUnfilteredTimelineSet().findEventById(redactId);
}
if (redactedEvent) { if (redactedEvent) {
redactedEvent.markLocallyRedacted(event); redactedEvent.markLocallyRedacted(event);
this.emit("Room.redaction", event, this); this.emit("Room.redaction", event, this);