From 8196a02f9d0e54c490e20e622c4f97e602d83447 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Mon, 31 May 2021 15:25:01 +0200 Subject: [PATCH] don't even need isOwn member anymore --- src/domain/session/room/timeline/tiles/BaseMessageTile.js | 3 +-- src/domain/session/room/timeline/tiles/SimpleTile.js | 8 ++++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/domain/session/room/timeline/tiles/BaseMessageTile.js b/src/domain/session/room/timeline/tiles/BaseMessageTile.js index 320aa833..704cccb8 100644 --- a/src/domain/session/room/timeline/tiles/BaseMessageTile.js +++ b/src/domain/session/room/timeline/tiles/BaseMessageTile.js @@ -20,7 +20,6 @@ import {getIdentifierColorNumber, avatarInitials, getAvatarHttpUrl} from "../../ export class BaseMessageTile extends SimpleTile { constructor(options) { super(options); - this._isOwn = this._entry.sender === options.timeline.me.userId; this._date = this._entry.timestamp ? new Date(this._entry.timestamp) : null; this._isContinuation = false; } @@ -67,7 +66,7 @@ export class BaseMessageTile extends SimpleTile { } get isOwn() { - return this._isOwn; + return this._entry.sender === this._ownMember.userId; } get isContinuation() { diff --git a/src/domain/session/room/timeline/tiles/SimpleTile.js b/src/domain/session/room/timeline/tiles/SimpleTile.js index b6c434df..449bd02a 100644 --- a/src/domain/session/room/timeline/tiles/SimpleTile.js +++ b/src/domain/session/room/timeline/tiles/SimpleTile.js @@ -121,10 +121,14 @@ export class SimpleTile extends ViewModel { // TilesCollection contract above get _room() { - return this.getOption("room"); + return this._options.room; } get _powerLevels() { - return this.getOption("timeline").powerLevels; + return this._options.timeline.powerLevels; + } + + get _ownMember() { + return this._options.timeline.me; } }