From 18be4cb202a2426fedce85cbd0378589ea521612 Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 10 Sep 2020 14:18:49 +0100 Subject: [PATCH] Use widget type fromString --- src/TextForEvent.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/TextForEvent.js b/src/TextForEvent.js index 084459c72e..82324aa57f 100644 --- a/src/TextForEvent.js +++ b/src/TextForEvent.js @@ -19,6 +19,7 @@ import { _t } from './languageHandler'; import * as Roles from './Roles'; import {isValid3pidInvite} from "./RoomInvite"; import SettingsStore from "./settings/SettingsStore"; +import {WidgetType} from "./widgets/WidgetType"; import {ALL_RULE_TYPES, ROOM_RULE_TYPES, SERVER_RULE_TYPES, USER_RULE_TYPES} from "./mjolnir/BanList"; function textForMemberEvent(ev) { @@ -475,7 +476,10 @@ function textForWidgetEvent(event) { const {name: prevName, type: prevType, url: prevUrl} = event.getPrevContent(); const {name, type, url} = event.getContent() || {}; - if (type === 'jitsi' || prevType === 'jitsi') { + const prevWidgetType = WidgetType.fromString(prevType); + const widgetType = WidgetType.fromString(type); + + if (widgetType === WidgetType.JITSI || prevWidgetType === WidgetType.JITSI) { return textForJitsiWidgetEvent(event, senderName, url, prevUrl); }