Use MessageBodyBuilder instead of linkify

Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
This commit is contained in:
RMidhunSuresh 2021-05-10 21:41:07 +05:30
parent 55f2d79d07
commit fc3b391aa9

View file

@ -15,7 +15,7 @@ limitations under the License.
*/
import {MessageTile} from "./MessageTile.js";
import { Linkifier } from "../Linkifier.js";
import { MessageBodyBuilder } from "../MessageBodyBuilder.js";
export class TextTile extends MessageTile {
get messageFormat() {
@ -24,7 +24,8 @@ export class TextTile extends MessageTile {
if (content.msgtype === "m.emote") {
body = `* ${this.displayName} ${body}`;
}
const obj = new Linkifier(body);
return obj.linkify();
const message = new MessageBodyBuilder();
message.fromText(body);
return message;
}
}