Return new message format instead of message text

Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
This commit is contained in:
RMidhunSuresh 2021-05-08 19:20:07 +05:30
parent 9ca0d93a01
commit 2f883d049c

View file

@ -15,15 +15,16 @@ limitations under the License.
*/ */
import {MessageTile} from "./MessageTile.js"; import {MessageTile} from "./MessageTile.js";
import { Linkifier } from "../../../../Linkifier.js";
export class TextTile extends MessageTile { export class TextTile extends MessageTile {
get text() { get messageFormat() {
const content = this._getContent(); const content = this._getContent();
const body = content && content.body; let body = content && content.body;
if (content.msgtype === "m.emote") { if (content.msgtype === "m.emote") {
return `* ${this.displayName} ${body}`; body = `* ${this.displayName} ${body}`;
} else { }
return body; const obj = new Linkifier(body);
} return obj.linkify();
} }
} }