Fix event list summaries including invalid events (#9041)

This commit is contained in:
Michael Telatynski 2022-07-11 16:25:11 +01:00 committed by GitHub
parent 7f07443161
commit 0bc2f1c101
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View file

@ -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()) {