diff --git a/src/domain/session/room/timeline/tiles/TextTile.js b/src/domain/session/room/timeline/tiles/TextTile.js index ba898963..34089b81 100644 --- a/src/domain/session/room/timeline/tiles/TextTile.js +++ b/src/domain/session/room/timeline/tiles/TextTile.js @@ -18,14 +18,22 @@ import {MessageTile} from "./MessageTile.js"; import { MessageBodyBuilder } from "../MessageBodyBuilder.js"; export class TextTile extends MessageTile { - get body() { + + get _contentBody() { const content = this._getContent(); let body = content?.body || ""; - if (content.msgtype === "m.emote") { + if (content.msgtype === "m.emote") body = `* ${this.displayName} ${body}`; - } + return body; + } + + get body() { + const body = this._contentBody; + if (body === this._body) + return this._message; const message = new MessageBodyBuilder(); message.fromText(body); + [this._body, this._message] = [body, message]; return message; } }