forked from mystiq/hydrogen-web
Prefer relations from encrypted content
This commit is contained in:
parent
5a0bc55e54
commit
1207203b00
1 changed files with 7 additions and 1 deletions
|
@ -16,7 +16,7 @@ limitations under the License.
|
||||||
|
|
||||||
import {BaseEventEntry} from "./BaseEventEntry.js";
|
import {BaseEventEntry} from "./BaseEventEntry.js";
|
||||||
import {getPrevContentFromStateEvent, isRedacted} from "../../common.js";
|
import {getPrevContentFromStateEvent, isRedacted} from "../../common.js";
|
||||||
import {getRelatedEventId} from "../relations.js";
|
import {getRelationFromContent, getRelatedEventId} from "../relations.js";
|
||||||
|
|
||||||
export class EventEntry extends BaseEventEntry {
|
export class EventEntry extends BaseEventEntry {
|
||||||
constructor(eventEntry, fragmentIdComparer) {
|
constructor(eventEntry, fragmentIdComparer) {
|
||||||
|
@ -139,6 +139,12 @@ export class EventEntry extends BaseEventEntry {
|
||||||
get annotations() {
|
get annotations() {
|
||||||
return this._eventEntry.annotations;
|
return this._eventEntry.annotations;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get relation() {
|
||||||
|
const originalContent = this._eventEntry.event.content;
|
||||||
|
const originalRelation = originalContent && getRelationFromContent(originalContent);
|
||||||
|
return originalRelation || getRelationFromContent(this.content);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
import {withTextBody, withContent, createEvent} from "../../../../mocks/event.js";
|
import {withTextBody, withContent, createEvent} from "../../../../mocks/event.js";
|
||||||
|
|
Loading…
Reference in a new issue