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

Add getRelation helper

This adds a `getRelation` helper to ensure we always read relation info from the
wire content as required in E2E rooms.
This commit is contained in:
J. Ryan Stinnett
2019-05-15 13:42:06 +01:00
parent ce0b014a5a
commit f17ecba519
4 changed files with 26 additions and 19 deletions

View File

@@ -1034,7 +1034,7 @@ Room.prototype._addLiveEvent = function(event, duplicateStrategy) {
if (this._opts.unstableClientRelationReplacements && event.isRelation("m.replace")) {
const relatesTo = event.getContent()["m.relates_to"];
const relatesTo = event.getRelation();
const replacedId = relatesTo && relatesTo.event_id;
const replacedEvent = this.getUnfilteredTimelineSet().findEventById(replacedId);
if (replacedEvent) {