diff --git a/src/BridgedRoom.ts b/src/BridgedRoom.ts
index 2c64c985..8366f332 100644
--- a/src/BridgedRoom.ts
+++ b/src/BridgedRoom.ts
@@ -400,7 +400,7 @@ export class BridgedRoom {
const avatarUrl = user.getAvatarUrlForRoom(message.room_id);
- if (avatarUrl && avatarUrl.indexOf("mxc://") === 0) {
+ if (avatarUrl && avatarUrl.startsWith("mxc://")) {
body.icon_url = this.main.getUrlForMxc(avatarUrl);
}
@@ -866,7 +866,7 @@ export class BridgedRoom {
if (event.content.format === "org.matrix.custom.html" && event.content.formatted_body) {
const formattedBody = event.content.formatted_body;
- if (formattedBody.startsWith("") && formattedBody.indexOf("") !== -1) {
+ if (formattedBody.startsWith("") && formattedBody.includes("")) {
const parts = formattedBody.split("");
realHtml = parts[1];
event.content.formatted_body = realHtml.trim();