diff --git a/src/components/structures/MessagePanel.tsx b/src/components/structures/MessagePanel.tsx index 231fd322d7..cd579a6648 100644 --- a/src/components/structures/MessagePanel.tsx +++ b/src/components/structures/MessagePanel.tsx @@ -60,7 +60,7 @@ import { hasThreadSummary } from "../../utils/EventUtils"; const CONTINUATION_MAX_INTERVAL = 5 * 60 * 1000; // 5 minutes const continuedTypes = [EventType.Sticker, EventType.RoomMessage]; -const groupedEvents = [ +const groupedStateEvents = [ EventType.RoomMember, EventType.RoomThirdPartyInvite, EventType.RoomServerAcl, @@ -1190,7 +1190,7 @@ class MainGrouper extends BaseGrouper { static canStartGroup = function(panel: MessagePanel, ev: MatrixEvent): boolean { if (!panel.shouldShowEvent(ev)) return false; - if (groupedEvents.includes(ev.getType() as EventType)) { + if (ev.isState() && groupedStateEvents.includes(ev.getType() as EventType)) { return true; } @@ -1225,7 +1225,7 @@ class MainGrouper extends BaseGrouper { if (this.panel.wantsDateSeparator(this.events[0], ev.getDate())) { return false; } - if (groupedEvents.includes(ev.getType() as EventType)) { + if (ev.isState() && groupedStateEvents.includes(ev.getType() as EventType)) { return true; } if (ev.isRedacted()) { diff --git a/src/utils/permalinks/Permalinks.ts b/src/utils/permalinks/Permalinks.ts index d4d6627051..404bf98769 100644 --- a/src/utils/permalinks/Permalinks.ts +++ b/src/utils/permalinks/Permalinks.ts @@ -19,6 +19,7 @@ import * as utils from "matrix-js-sdk/src/utils"; import { Room } from "matrix-js-sdk/src/models/room"; import { logger } from "matrix-js-sdk/src/logger"; import { RoomStateEvent } from "matrix-js-sdk/src/models/room-state"; +import { EventType } from "matrix-js-sdk/src/@types/event"; import { MatrixClientPeg } from "../../MatrixClientPeg"; import MatrixToPermalinkConstructor, { baseUrl as matrixtoBaseUrl } from "./MatrixToPermalinkConstructor"; @@ -211,7 +212,7 @@ export class RoomPermalinkCreator { const bannedHostsRegexps = []; let allowedHostsRegexps = [ANY_REGEX]; // default allow everyone if (this.room.currentState) { - const aclEvent = this.room.currentState.getStateEvents("m.room.server_acl", ""); + const aclEvent = this.room.currentState.getStateEvents(EventType.RoomServerAcl, ""); if (aclEvent && aclEvent.getContent()) { const getRegex = (hostname) => new RegExp("^" + utils.globToRegexp(hostname, false) + "$");