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

Commit

Permalink
Stop displaying verification done messages in timeline (#11932)
Browse files Browse the repository at this point in the history
* Stop displaying verification done messages in timeline

* i18n fixes
  • Loading branch information
andybalaam authored Dec 1, 2023
1 parent f07a880 commit 9269073
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 326 deletions.
144 changes: 0 additions & 144 deletions src/components/views/messages/MKeyVerificationConclusion.tsx

This file was deleted.

21 changes: 0 additions & 21 deletions src/events/EventTileFactory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import LegacyCallEventGrouper from "../components/structures/LegacyCallEventGrou
import { EventTileProps } from "../components/views/rooms/EventTile";
import { TimelineRenderingType } from "../contexts/RoomContext";
import MessageEvent from "../components/views/messages/MessageEvent";
import MKeyVerificationConclusion from "../components/views/messages/MKeyVerificationConclusion";
import LegacyCallEvent from "../components/views/messages/LegacyCallEvent";
import { CallEvent } from "../components/views/messages/CallEvent";
import TextualEvent from "../components/views/messages/TextualEvent";
Expand Down Expand Up @@ -87,7 +86,6 @@ type FactoryProps = Omit<EventTileTypeProps, "ref">;
type Factory<X = FactoryProps> = (ref: Optional<React.RefObject<any>>, props: X) => JSX.Element;

export const MessageEventFactory: Factory = (ref, props) => <MessageEvent ref={ref} {...props} />;
const KeyVerificationConclFactory: Factory = (ref, props) => <MKeyVerificationConclusion ref={ref} {...props} />;
const LegacyCallEventFactory: Factory<FactoryProps & { callEventGrouper: LegacyCallEventGrouper }> = (ref, props) => (
<LegacyCallEvent ref={ref} {...props} />
);
Expand All @@ -108,8 +106,6 @@ const EVENT_TILE_TYPES = new Map<string, Factory>([
[M_POLL_START.altName, MessageEventFactory],
[M_POLL_END.name, MessageEventFactory],
[M_POLL_END.altName, MessageEventFactory],
[EventType.KeyVerificationCancel, KeyVerificationConclFactory],
[EventType.KeyVerificationDone, KeyVerificationConclFactory],
[EventType.CallInvite, LegacyCallEventFactory as Factory], // note that this requires a special factory type
]);

Expand Down Expand Up @@ -205,23 +201,6 @@ export function pickFactory(
return VerificationReqFactory;
}
}
} else if (evType === EventType.KeyVerificationDone) {
// these events are sent by both parties during verification, but we only want to render one
// tile once the verification concludes, so filter out the one from the other party.
const me = cli.getUserId();
if (mxEvent.getSender() !== me) {
return noEventFactoryFactory();
}
}

if (evType === EventType.KeyVerificationCancel || evType === EventType.KeyVerificationDone) {
// sometimes MKeyVerificationConclusion declines to render. Jankily decline to render and
// fall back to showing hidden events, if we're viewing hidden events
// XXX: This is extremely a hack. Possibly these components should have an interface for
// declining to render?
if (!MKeyVerificationConclusion.shouldRender(mxEvent, mxEvent.verificationRequest)) {
return noEventFactoryFactory();
}
}

if (evType === EventType.RoomCreate) {
Expand Down
5 changes: 0 additions & 5 deletions src/i18n/strings/en_EN.json
Original file line number Diff line number Diff line change
Expand Up @@ -3261,11 +3261,6 @@
"sent": "%(senderDisplayName)s sent an image.",
"show_image": "Show image"
},
"m.key.verification.cancel": {
"user_cancelled": "%(name)s cancelled verifying",
"you_cancelled": "You cancelled verifying %(name)s"
},
"m.key.verification.done": "You verified %(name)s",
"m.key.verification.request": {
"user_wants_to_verify": "%(name)s wants to verify",
"you_started": "You sent a verification request"
Expand Down
156 changes: 0 additions & 156 deletions test/components/views/messages/MKeyVerificationConclusion-test.tsx

This file was deleted.

0 comments on commit 9269073

Please sign in to comment.