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

Commit

Permalink
Fix regression of edits showing up in the timeline with hidden events…
Browse files Browse the repository at this point in the history
… shown (#8260)
  • Loading branch information
t3chguy authored and dbkr committed Apr 8, 2022
1 parent 28d6fd6 commit 8fab9be
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/events/EventTileFactory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,10 @@ export function pickFactory(mxEvent: MatrixEvent, cli: MatrixClient, asHiddenEv?
return MessageEventFactory;
}

if (mxEvent.isRelation(RelationType.Replace)) {
return noEventFactoryFactory();
}

return EVENT_TILE_TYPES[evType] ?? noEventFactoryFactory();
}

Expand Down
5 changes: 3 additions & 2 deletions src/shouldHideEvent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/

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

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

function memberEventDiff(ev: MatrixEvent): IDiff {
const diff: IDiff = {
isMemberEvent: ev.getType() === 'm.room.member',
isMemberEvent: ev.getType() === EventType.RoomMember,
};

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

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

const eventDiff = memberEventDiff(ev);

Expand Down

0 comments on commit 8fab9be

Please sign in to comment.