rename MessageTile to BaseMessageTile

since MessageTile doesn't have a shape property anymore
This commit is contained in:
Bruno Windels 2021-05-17 12:15:13 +02:00
parent 67714040e7
commit ce976226f9
6 changed files with 11 additions and 11 deletions

View File

@ -15,12 +15,12 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import {MessageTile} from "./MessageTile.js"; import {BaseMessageTile} from "./BaseMessageTile.js";
import {SendStatus} from "../../../../../matrix/room/sending/PendingEvent.js"; import {SendStatus} from "../../../../../matrix/room/sending/PendingEvent.js";
const MAX_HEIGHT = 300; const MAX_HEIGHT = 300;
const MAX_WIDTH = 400; const MAX_WIDTH = 400;
export class BaseMediaTile extends MessageTile { export class BaseMediaTile extends BaseMessageTile {
constructor(options) { constructor(options) {
super(options); super(options);
this._decryptedThumbnail = null; this._decryptedThumbnail = null;

View File

@ -17,7 +17,7 @@ limitations under the License.
import {SimpleTile} from "./SimpleTile.js"; import {SimpleTile} from "./SimpleTile.js";
import {getIdentifierColorNumber, avatarInitials, getAvatarHttpUrl} from "../../../../avatar.js"; import {getIdentifierColorNumber, avatarInitials, getAvatarHttpUrl} from "../../../../avatar.js";
export class MessageTile extends SimpleTile { export class BaseMessageTile extends SimpleTile {
constructor(options) { constructor(options) {
super(options); super(options);
this._isOwn = this._entry.sender === options.ownUserId; this._isOwn = this._entry.sender === options.ownUserId;
@ -85,7 +85,7 @@ export class MessageTile extends SimpleTile {
updatePreviousSibling(prev) { updatePreviousSibling(prev) {
super.updatePreviousSibling(prev); super.updatePreviousSibling(prev);
let isContinuation = false; 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 // timestamp is null for pending events
const myTimestamp = this._entry.timestamp || this.clock.now(); const myTimestamp = this._entry.timestamp || this.clock.now();
const otherTimestamp = prev._entry.timestamp || this.clock.now(); const otherTimestamp = prev._entry.timestamp || this.clock.now();

View File

@ -15,11 +15,11 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import {MessageTile} from "./MessageTile.js"; import {BaseMessageTile} from "./BaseMessageTile.js";
import {formatSize} from "../../../../../utils/formatSize.js"; import {formatSize} from "../../../../../utils/formatSize.js";
import {SendStatus} from "../../../../../matrix/room/sending/PendingEvent.js"; import {SendStatus} from "../../../../../matrix/room/sending/PendingEvent.js";
export class FileTile extends MessageTile { export class FileTile extends BaseMessageTile {
constructor(options) { constructor(options) {
super(options); super(options);
this._downloadError = null; this._downloadError = null;

View File

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import {MessageTile} from "./MessageTile.js"; import {BaseMessageTile} from "./BaseMessageTile.js";
/* /*
map urls: map urls:
@ -23,7 +23,7 @@ android: https://developers.google.com/maps/documentation/urls/guide
wp: maps:49.275267 -122.988617 wp: maps:49.275267 -122.988617
https://www.habaneroconsulting.com/stories/insights/2011/opening-native-map-apps-from-the-mobile-browser 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() { get mapsLink() {
const geoUri = this._getContent().geo_uri; const geoUri = this._getContent().geo_uri;
const [lat, long] = geoUri.split(":")[1].split(","); const [lat, long] = geoUri.split(":")[1].split(",");

View File

@ -14,9 +14,9 @@ See the License for the specific language governing permissions and
limitations under the License. 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() { get shape() {
return "missing-attachment" return "missing-attachment"
} }

View File

@ -31,7 +31,7 @@ export class SimpleTile extends ViewModel {
} }
// don't show display name / avatar // don't show display name / avatar
// probably only for MessageTiles of some sort? // probably only for BaseMessageTiles of some sort?
get isContinuation() { get isContinuation() {
return false; return false;
} }