You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-12-05 17:02:07 +03:00
use relation handling in timelineset for replacements
This commit is contained in:
@@ -1032,25 +1032,6 @@ Room.prototype._addLiveEvent = function(event, duplicateStrategy) {
|
||||
// this may be needed to trigger an update.
|
||||
}
|
||||
|
||||
|
||||
if (this._opts.unstableClientRelationReplacements && event.isRelation("m.replace")) {
|
||||
const relatesTo = event.getRelation();
|
||||
const replacedId = relatesTo && relatesTo.event_id;
|
||||
const replacedEvent = this.getUnfilteredTimelineSet().findEventById(replacedId);
|
||||
if (replacedEvent && event.getSender() === replacedEvent.getSender()) {
|
||||
const doAndEmitReplacement = () => {
|
||||
replacedEvent.makeReplaced(event);
|
||||
this.emit("Room.replaceEvent", replacedEvent, this);
|
||||
};
|
||||
|
||||
if (event.isBeingDecrypted()) {
|
||||
event.once("Event.decrypted", doAndEmitReplacement);
|
||||
} else {
|
||||
doAndEmitReplacement();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (event.getUnsigned().transaction_id) {
|
||||
const existingEvent = this._txnToEvent[event.getUnsigned().transaction_id];
|
||||
if (existingEvent) {
|
||||
|
||||
Reference in New Issue
Block a user