Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 8fab9be

Browse files
t3chguydbkr
authored andcommitted
Fix regression of edits showing up in the timeline with hidden events shown (#8260)
1 parent 28d6fd6 commit 8fab9be

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/events/EventTileFactory.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,10 @@ export function pickFactory(mxEvent: MatrixEvent, cli: MatrixClient, asHiddenEv?
231231
return MessageEventFactory;
232232
}
233233

234+
if (mxEvent.isRelation(RelationType.Replace)) {
235+
return noEventFactoryFactory();
236+
}
237+
234238
return EVENT_TILE_TYPES[evType] ?? noEventFactoryFactory();
235239
}
236240

src/shouldHideEvent.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*/
1616

1717
import { MatrixEvent } from "matrix-js-sdk/src/models/event";
18+
import { EventType, RelationType } from "matrix-js-sdk/src/@types/event";
1819

1920
import SettingsStore from "./settings/SettingsStore";
2021
import { IRoomState } from "./components/structures/RoomView";
@@ -29,7 +30,7 @@ interface IDiff {
2930

3031
function memberEventDiff(ev: MatrixEvent): IDiff {
3132
const diff: IDiff = {
32-
isMemberEvent: ev.getType() === 'm.room.member',
33+
isMemberEvent: ev.getType() === EventType.RoomMember,
3334
};
3435

3536
// If is not a Member Event then the other checks do not apply, so bail early.
@@ -67,7 +68,7 @@ export default function shouldHideEvent(ev: MatrixEvent, ctx?: IRoomState): bool
6768
if (ev.isRedacted() && !isEnabled('showRedactions') && !ev.getThread()) return true;
6869

6970
// Hide replacement events since they update the original tile (if enabled)
70-
if (ev.isRelation("m.replace")) return true;
71+
if (ev.isRelation(RelationType.Replace)) return true;
7172

7273
const eventDiff = memberEventDiff(ev);
7374

0 commit comments

Comments
 (0)