You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-23 17:02:25 +03:00
Ignore m.replace relations on state events, they're invalid (#2306)
* Ignore m.replace relations on state events, they're invalid * Add tests * Fix test Co-authored-by: Kerry <kerrya@element.io>
This commit is contained in:
committed by
GitHub
parent
ac08e52410
commit
ba06e430c4
@@ -1336,6 +1336,10 @@ export class MatrixEvent extends TypedEventEmitter<EmittedEvents, MatrixEventHan
|
||||
if (this.isRedacted() && newEvent) {
|
||||
return;
|
||||
}
|
||||
// don't allow state events to be replaced using this mechanism as per MSC2676
|
||||
if (this.isState()) {
|
||||
return;
|
||||
}
|
||||
if (this._replacingEvent !== newEvent) {
|
||||
this._replacingEvent = newEvent;
|
||||
this.emit(MatrixEventEvent.Replaced, this);
|
||||
|
||||
Reference in New Issue
Block a user