From ce976226f9f0bd72b520e3159338be056a80d18b Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Mon, 17 May 2021 12:15:13 +0200 Subject: [PATCH] rename MessageTile to BaseMessageTile since MessageTile doesn't have a shape property anymore --- src/domain/session/room/timeline/tiles/BaseMediaTile.js | 4 ++-- .../timeline/tiles/{MessageTile.js => BaseMessageTile.js} | 4 ++-- src/domain/session/room/timeline/tiles/FileTile.js | 4 ++-- src/domain/session/room/timeline/tiles/LocationTile.js | 4 ++-- .../session/room/timeline/tiles/MissingAttachmentTile.js | 4 ++-- src/domain/session/room/timeline/tiles/SimpleTile.js | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) rename src/domain/session/room/timeline/tiles/{MessageTile.js => BaseMessageTile.js} (95%) diff --git a/src/domain/session/room/timeline/tiles/BaseMediaTile.js b/src/domain/session/room/timeline/tiles/BaseMediaTile.js index 26862902..e5e62107 100644 --- a/src/domain/session/room/timeline/tiles/BaseMediaTile.js +++ b/src/domain/session/room/timeline/tiles/BaseMediaTile.js @@ -15,12 +15,12 @@ See the License for the specific language governing permissions and limitations under the License. */ -import {MessageTile} from "./MessageTile.js"; +import {BaseMessageTile} from "./BaseMessageTile.js"; import {SendStatus} from "../../../../../matrix/room/sending/PendingEvent.js"; const MAX_HEIGHT = 300; const MAX_WIDTH = 400; -export class BaseMediaTile extends MessageTile { +export class BaseMediaTile extends BaseMessageTile { constructor(options) { super(options); this._decryptedThumbnail = null; diff --git a/src/domain/session/room/timeline/tiles/MessageTile.js b/src/domain/session/room/timeline/tiles/BaseMessageTile.js similarity index 95% rename from src/domain/session/room/timeline/tiles/MessageTile.js rename to src/domain/session/room/timeline/tiles/BaseMessageTile.js index 1769748d..a348a249 100644 --- a/src/domain/session/room/timeline/tiles/MessageTile.js +++ b/src/domain/session/room/timeline/tiles/BaseMessageTile.js @@ -17,7 +17,7 @@ limitations under the License. import {SimpleTile} from "./SimpleTile.js"; import {getIdentifierColorNumber, avatarInitials, getAvatarHttpUrl} from "../../../../avatar.js"; -export class MessageTile extends SimpleTile { +export class BaseMessageTile extends SimpleTile { constructor(options) { super(options); this._isOwn = this._entry.sender === options.ownUserId; @@ -85,7 +85,7 @@ export class MessageTile extends SimpleTile { updatePreviousSibling(prev) { super.updatePreviousSibling(prev); let isContinuation = false; - if (prev && prev instanceof MessageTile && prev.sender === this.sender) { + if (prev && prev instanceof BaseMessageTile && prev.sender === this.sender) { // timestamp is null for pending events const myTimestamp = this._entry.timestamp || this.clock.now(); const otherTimestamp = prev._entry.timestamp || this.clock.now(); diff --git a/src/domain/session/room/timeline/tiles/FileTile.js b/src/domain/session/room/timeline/tiles/FileTile.js index 5770f7e0..c761e68e 100644 --- a/src/domain/session/room/timeline/tiles/FileTile.js +++ b/src/domain/session/room/timeline/tiles/FileTile.js @@ -15,11 +15,11 @@ See the License for the specific language governing permissions and limitations under the License. */ -import {MessageTile} from "./MessageTile.js"; +import {BaseMessageTile} from "./BaseMessageTile.js"; import {formatSize} from "../../../../../utils/formatSize.js"; import {SendStatus} from "../../../../../matrix/room/sending/PendingEvent.js"; -export class FileTile extends MessageTile { +export class FileTile extends BaseMessageTile { constructor(options) { super(options); this._downloadError = null; diff --git a/src/domain/session/room/timeline/tiles/LocationTile.js b/src/domain/session/room/timeline/tiles/LocationTile.js index 58870361..fddc4501 100644 --- a/src/domain/session/room/timeline/tiles/LocationTile.js +++ b/src/domain/session/room/timeline/tiles/LocationTile.js @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import {MessageTile} from "./MessageTile.js"; +import {BaseMessageTile} from "./BaseMessageTile.js"; /* map urls: @@ -23,7 +23,7 @@ android: https://developers.google.com/maps/documentation/urls/guide wp: maps:49.275267 -122.988617 https://www.habaneroconsulting.com/stories/insights/2011/opening-native-map-apps-from-the-mobile-browser */ -export class LocationTile extends MessageTile { +export class LocationTile extends BaseMessageTile { get mapsLink() { const geoUri = this._getContent().geo_uri; const [lat, long] = geoUri.split(":")[1].split(","); diff --git a/src/domain/session/room/timeline/tiles/MissingAttachmentTile.js b/src/domain/session/room/timeline/tiles/MissingAttachmentTile.js index 0a9b5976..847901ac 100644 --- a/src/domain/session/room/timeline/tiles/MissingAttachmentTile.js +++ b/src/domain/session/room/timeline/tiles/MissingAttachmentTile.js @@ -14,9 +14,9 @@ See the License for the specific language governing permissions and limitations under the License. */ -import {MessageTile} from "./MessageTile.js"; +import {BaseMessageTile} from "./BaseMessageTile.js"; -export class MissingAttachmentTile extends MessageTile { +export class MissingAttachmentTile extends BaseMessageTile { get shape() { return "missing-attachment" } diff --git a/src/domain/session/room/timeline/tiles/SimpleTile.js b/src/domain/session/room/timeline/tiles/SimpleTile.js index f63fde74..ea5640bd 100644 --- a/src/domain/session/room/timeline/tiles/SimpleTile.js +++ b/src/domain/session/room/timeline/tiles/SimpleTile.js @@ -31,7 +31,7 @@ export class SimpleTile extends ViewModel { } // don't show display name / avatar - // probably only for MessageTiles of some sort? + // probably only for BaseMessageTiles of some sort? get isContinuation() { return false; }