Room list: move MessagePreviewStore and previews into its own directory (#32710)

* refactor: move `MessagePreviewStore` and previews into its own directory

The `MessagePreviewStore` is used widly and not only by the room list.
Moving to its own folder to be able to remove old room list later with
less friction

* test: add more tests
This commit is contained in:
Florian Duros 2026-03-04 18:40:12 +01:00 committed by GitHub
parent 1c66f0ba01
commit 1963f268aa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
26 changed files with 412 additions and 27 deletions

View File

@ -11,7 +11,7 @@ import { type IContent, M_POLL_START, type MatrixEvent, MatrixEventEvent, MsgTyp
import classNames from "classnames";
import { _t } from "../../../languageHandler";
import { MessagePreviewStore } from "../../../stores/room-list/MessagePreviewStore";
import { MessagePreviewStore } from "../../../stores/message-preview";
import { useAsyncMemo } from "../../../hooks/useAsyncMemo";
import MatrixClientContext from "../../../contexts/MatrixClientContext";
import { useTypedEventEmitter } from "../../../hooks/useEventEmitter.ts";

View File

@ -21,7 +21,7 @@ import { Action } from "../../../dispatcher/actions";
import { _t } from "../../../languageHandler";
import { ChevronFace, ContextMenuTooltipButton, type MenuProps } from "../../structures/ContextMenu";
import { DefaultTagID, type TagID } from "../../../stores/room-list-v3/skip-list/tag";
import { type MessagePreview, MessagePreviewStore } from "../../../stores/room-list/MessagePreviewStore";
import { type MessagePreview, MessagePreviewStore } from "../../../stores/message-preview";
import DecoratedRoomAvatar from "../avatars/DecoratedRoomAvatar";
import { RoomNotifState } from "../../../RoomNotifs";
import { MatrixClientPeg } from "../../../MatrixClientPeg";

View File

@ -10,7 +10,7 @@ import React from "react";
import classNames from "classnames";
import { ThreadsIcon } from "@vector-im/compound-design-tokens/assets/web/icons";
import { type MessagePreview } from "../../../stores/room-list/MessagePreviewStore";
import { type MessagePreview } from "../../../stores/message-preview";
import { type Call } from "../../../models/Call";
import { RoomTileCallSummary } from "./RoomTileCallSummary";

View File

@ -29,7 +29,7 @@ import { LegacyCallHangupEvent } from "./previews/LegacyCallHangupEvent";
import { StickerEventPreview } from "./previews/StickerEventPreview";
import { ReactionEventPreview } from "./previews/ReactionEventPreview";
import { UPDATE_EVENT } from "../AsyncStore";
import { type IPreview } from "./previews/IPreview";
import { type Preview } from "./previews";
import shouldHideEvent from "../../shouldHideEvent";
import SettingsStore from "../../settings/SettingsStore";
@ -41,7 +41,7 @@ const PREVIEWS: Record<
string,
{
isState: boolean;
previewer: IPreview;
previewer: Preview;
}
> = {
"m.room.message": {

View File

@ -0,0 +1,8 @@
/*
* Copyright 2026 Element Creations Ltd.
*
* SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
* Please see LICENSE files in the repository root for full details.
*/
export { type MessagePreview, MessagePreviewStore } from "./MessagePreviewStore";

View File

@ -8,12 +8,12 @@ Please see LICENSE files in the repository root for full details.
import { type MatrixEvent } from "matrix-js-sdk/src/matrix";
import { type IPreview } from "./IPreview";
import { type Preview } from "./Preview";
import { type TagID } from "../../room-list-v3/skip-list/tag";
import { getSenderName, isSelf, shouldPrefixMessagesIn } from "./utils";
import { _t } from "../../../languageHandler";
export class LegacyCallAnswerEventPreview implements IPreview {
export class LegacyCallAnswerEventPreview implements Preview {
public getTextFor(event: MatrixEvent, tagId?: TagID): string {
if (shouldPrefixMessagesIn(event.getRoomId()!, tagId)) {
if (isSelf(event)) {

View File

@ -8,12 +8,12 @@ Please see LICENSE files in the repository root for full details.
import { type MatrixEvent } from "matrix-js-sdk/src/matrix";
import { type IPreview } from "./IPreview";
import { type Preview } from "./Preview";
import { type TagID } from "../../room-list-v3/skip-list/tag";
import { getSenderName, isSelf, shouldPrefixMessagesIn } from "./utils";
import { _t } from "../../../languageHandler";
export class LegacyCallHangupEvent implements IPreview {
export class LegacyCallHangupEvent implements Preview {
public getTextFor(event: MatrixEvent, tagId?: TagID): string {
if (shouldPrefixMessagesIn(event.getRoomId()!, tagId)) {
if (isSelf(event)) {

View File

@ -8,12 +8,12 @@ Please see LICENSE files in the repository root for full details.
import { type MatrixEvent } from "matrix-js-sdk/src/matrix";
import { type IPreview } from "./IPreview";
import { type Preview } from "./Preview";
import { type TagID } from "../../room-list-v3/skip-list/tag";
import { getSenderName, isSelf, shouldPrefixMessagesIn } from "./utils";
import { _t } from "../../../languageHandler";
export class LegacyCallInviteEventPreview implements IPreview {
export class LegacyCallInviteEventPreview implements Preview {
public getTextFor(event: MatrixEvent, tagId?: TagID): string {
if (shouldPrefixMessagesIn(event.getRoomId()!, tagId)) {
if (isSelf(event)) {

View File

@ -8,14 +8,14 @@ Please see LICENSE files in the repository root for full details.
import { type MatrixEvent, MsgType, RelationType } from "matrix-js-sdk/src/matrix";
import { type IPreview } from "./IPreview";
import { type Preview } from "./Preview";
import { type TagID } from "../../room-list-v3/skip-list/tag";
import { _t, sanitizeForTranslation } from "../../../languageHandler";
import { getSenderName, isSelf, shouldPrefixMessagesIn } from "./utils";
import { getHtmlText } from "../../../HtmlUtils";
import { stripHTMLReply, stripPlainReply } from "../../../utils/Reply";
export class MessageEventPreview implements IPreview {
export class MessageEventPreview implements Preview {
public getTextFor(event: MatrixEvent, tagId?: TagID, isThread?: boolean): string | null {
let eventContent = event.getContent();

View File

@ -10,13 +10,13 @@ import { type MatrixEvent, type PollStartEventContent } from "matrix-js-sdk/src/
import { InvalidEventError } from "matrix-js-sdk/src/extensible_events_v1/InvalidEventError";
import { PollStartEvent } from "matrix-js-sdk/src/extensible_events_v1/PollStartEvent";
import { type IPreview } from "./IPreview";
import { type Preview } from "./Preview";
import { type TagID } from "../../room-list-v3/skip-list/tag";
import { _t, sanitizeForTranslation } from "../../../languageHandler";
import { getSenderName, isSelf, shouldPrefixMessagesIn } from "./utils";
import MatrixClientContext from "../../../contexts/MatrixClientContext";
export class PollStartEventPreview implements IPreview {
export class PollStartEventPreview implements Preview {
public static contextType = MatrixClientContext;
declare public context: React.ContextType<typeof MatrixClientContext>;

View File

@ -13,7 +13,7 @@ import { type TagID } from "../../room-list-v3/skip-list/tag";
/**
* Represents an event preview.
*/
export interface IPreview {
export interface Preview {
/**
* Gets the text which represents the event as a preview.
* @param event The event to preview.

View File

@ -8,14 +8,14 @@ Please see LICENSE files in the repository root for full details.
import { type MatrixEvent } from "matrix-js-sdk/src/matrix";
import { type IPreview } from "./IPreview";
import { type Preview } from "./Preview";
import { type TagID } from "../../room-list-v3/skip-list/tag";
import { getSenderName, isSelf } from "./utils";
import { _t } from "../../../languageHandler";
import { MatrixClientPeg } from "../../../MatrixClientPeg";
import { MessagePreviewStore } from "../MessagePreviewStore";
export class ReactionEventPreview implements IPreview {
export class ReactionEventPreview implements Preview {
public getTextFor(event: MatrixEvent, tagId?: TagID, isThread?: boolean): string | null {
const roomId = event.getRoomId();
if (!roomId) return null; // not a room event

View File

@ -8,12 +8,12 @@ Please see LICENSE files in the repository root for full details.
import { type MatrixEvent } from "matrix-js-sdk/src/matrix";
import { type IPreview } from "./IPreview";
import { type Preview } from "./Preview";
import { type TagID } from "../../room-list-v3/skip-list/tag";
import { getSenderName, isSelf, shouldPrefixMessagesIn } from "./utils";
import { _t } from "../../../languageHandler";
export class StickerEventPreview implements IPreview {
export class StickerEventPreview implements Preview {
public getTextFor(event: MatrixEvent, tagId?: TagID, isThread?: boolean): string | null {
const stickerName = event.getContent()["body"];
if (!stickerName) return null;

View File

@ -0,0 +1,14 @@
/*
* Copyright 2026 Element Creations Ltd.
*
* SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
* Please see LICENSE files in the repository root for full details.
*/
export type * from "./Preview";
export * from "./LegacyCallAnswerEventPreview";
export * from "./LegacyCallHangupEvent";
export * from "./MessageEventPreview";
export * from "./StickerEventPreview";
export * from "./PollStartEventPreview";
export * from "./ReactionEventPreview";

View File

@ -18,7 +18,7 @@ import type { Room, MatrixClient, RoomMember } from "matrix-js-sdk/src/matrix";
import type { RoomNotificationState } from "../../stores/notifications/RoomNotificationState";
import { RoomNotificationStateStore } from "../../stores/notifications/RoomNotificationStateStore";
import { NotificationStateEvents } from "../../stores/notifications/NotificationState";
import { MessagePreviewStore } from "../../stores/room-list/MessagePreviewStore";
import { MessagePreviewStore } from "../../stores/message-preview";
import { UPDATE_EVENT } from "../../stores/AsyncStore";
import { DefaultTagID } from "../../stores/room-list-v3/skip-list/tag";
import DMRoomMap from "../../utils/DMRoomMap";

View File

@ -42,7 +42,7 @@ import { TestSdkContext } from "../../../TestSdkContext";
import { SDKContext } from "../../../../../src/contexts/SDKContext";
import { shouldShowComponent } from "../../../../../src/customisations/helpers/UIComponents";
import { UIComponent } from "../../../../../src/settings/UIFeature";
import { MessagePreviewStore } from "../../../../../src/stores/room-list/MessagePreviewStore";
import { MessagePreviewStore } from "../../../../../src/stores/message-preview";
import { MatrixClientPeg } from "../../../../../src/MatrixClientPeg";
import SettingsStore from "../../../../../src/settings/SettingsStore";
import { ConnectionState } from "../../../../../src/models/Call";

View File

@ -18,7 +18,7 @@ import {
Room,
} from "matrix-js-sdk/src/matrix";
import { MessagePreviewStore } from "../../../../src/stores/room-list/MessagePreviewStore";
import { MessagePreviewStore } from "../../../../src/stores/message-preview";
import { mkEvent, mkMessage, mkReaction, setupAsyncStoreWithClient, stubClient } from "../../../test-utils";
import { DefaultTagID } from "../../../../src/stores/room-list-v3/skip-list/tag";
import { mkThread } from "../../../test-utils/threads";

View File

@ -0,0 +1,79 @@
/*
* Copyright 2026 Element Creations Ltd.
*
* SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
* Please see LICENSE files in the repository root for full details.
*/
import { Room } from "matrix-js-sdk/src/matrix";
import { mocked } from "jest-mock";
import { LegacyCallAnswerEventPreview } from "../../../../../src/stores/message-preview/previews/LegacyCallAnswerEventPreview";
import { DefaultTagID } from "../../../../../src/stores/room-list-v3/skip-list/tag";
import { mkEvent, stubClient } from "../../../../test-utils";
import { MatrixClientPeg } from "../../../../../src/MatrixClientPeg";
describe("LegacyCallAnswerEventPreview", () => {
const preview = new LegacyCallAnswerEventPreview();
const roomId = "!room:example.com";
beforeAll(() => {
stubClient();
});
describe("getTextFor", () => {
describe("in a room that should be prefixed (non-DM)", () => {
// Default stub: getRoom returns null → shouldPrefixMessagesIn returns true
it("returns 'You joined the call' when the event is from self", () => {
const selfUserId = MatrixClientPeg.safeGet().getSafeUserId();
const event = mkEvent({
event: true,
type: "m.call.answer",
content: {},
user: selfUserId,
room: roomId,
});
expect(preview.getTextFor(event)).toBe("You joined the call");
});
it("returns '<sender> joined the call' when the event is from someone else", () => {
const otherUserId = "@other:example.com";
const event = mkEvent({
event: true,
type: "m.call.answer",
content: {},
user: otherUserId,
room: roomId,
});
expect(preview.getTextFor(event)).toBe(`${otherUserId} joined the call`);
});
});
describe("in a DM room (should not be prefixed)", () => {
beforeEach(() => {
const cli = MatrixClientPeg.safeGet();
// Make a 1:1 room so shouldPrefixMessagesIn returns false
const room = new Room(roomId, cli, cli.getSafeUserId());
jest.spyOn(room.currentState, "getJoinedMemberCount").mockReturnValue(2);
mocked(cli.getRoom).mockReturnValue(room);
});
afterEach(() => {
mocked(MatrixClientPeg.safeGet().getRoom).mockReturnValue(null);
});
it("returns 'Call in progress' regardless of sender", () => {
const otherUserId = "@other:example.com";
const event = mkEvent({
event: true,
type: "m.call.answer",
content: {},
user: otherUserId,
room: roomId,
});
expect(preview.getTextFor(event, DefaultTagID.DM)).toBe("Call in progress");
});
});
});
});

View File

@ -0,0 +1,77 @@
/*
* Copyright 2026 Element Creations Ltd.
*
* SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
* Please see LICENSE files in the repository root for full details.
*/
import { Room } from "matrix-js-sdk/src/matrix";
import { mocked } from "jest-mock";
import { LegacyCallHangupEvent } from "../../../../../src/stores/message-preview/previews/LegacyCallHangupEvent";
import { DefaultTagID } from "../../../../../src/stores/room-list-v3/skip-list/tag";
import { mkEvent, stubClient } from "../../../../test-utils";
import { MatrixClientPeg } from "../../../../../src/MatrixClientPeg";
describe("LegacyCallHangupEvent", () => {
const preview = new LegacyCallHangupEvent();
const roomId = "!room:example.com";
beforeAll(() => {
stubClient();
});
describe("getTextFor", () => {
describe("in a room that should be prefixed (non-DM)", () => {
it("returns 'You ended the call' when the event is from self", () => {
const selfUserId = MatrixClientPeg.safeGet().getSafeUserId();
const event = mkEvent({
event: true,
type: "m.call.hangup",
content: {},
user: selfUserId,
room: roomId,
});
expect(preview.getTextFor(event)).toBe("You ended the call");
});
it("returns '<sender> ended the call' when the event is from someone else", () => {
const otherUserId = "@other:example.com";
const event = mkEvent({
event: true,
type: "m.call.hangup",
content: {},
user: otherUserId,
room: roomId,
});
expect(preview.getTextFor(event)).toBe(`${otherUserId} ended the call`);
});
});
describe("in a DM room (should not be prefixed)", () => {
beforeEach(() => {
const cli = MatrixClientPeg.safeGet();
// Make a 1:1 room so shouldPrefixMessagesIn returns false
const room = new Room(roomId, cli, cli.getSafeUserId());
jest.spyOn(room.currentState, "getJoinedMemberCount").mockReturnValue(2);
mocked(cli.getRoom).mockReturnValue(room);
});
afterEach(() => {
mocked(MatrixClientPeg.safeGet().getRoom).mockReturnValue(null);
});
it("returns 'Call ended' regardless of sender", () => {
const otherUserId = "@other:example.com";
const event = mkEvent({
event: true,
type: "m.call.hangup",
content: {},
user: otherUserId,
room: roomId,
});
expect(preview.getTextFor(event, DefaultTagID.DM)).toBe("Call ended");
});
});
});
});

View File

@ -0,0 +1,89 @@
/*
* Copyright 2026 Element Creations Ltd.
*
* SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
* Please see LICENSE files in the repository root for full details.
*/
import { Room } from "matrix-js-sdk/src/matrix";
import { mocked } from "jest-mock";
import { LegacyCallInviteEventPreview } from "../../../../../src/stores/message-preview/previews/LegacyCallInviteEventPreview";
import { DefaultTagID } from "../../../../../src/stores/room-list-v3/skip-list/tag";
import { mkEvent, stubClient } from "../../../../test-utils";
import { MatrixClientPeg } from "../../../../../src/MatrixClientPeg";
describe("LegacyCallInviteEventPreview", () => {
const preview = new LegacyCallInviteEventPreview();
const roomId = "!room:example.com";
beforeAll(() => {
stubClient();
});
describe("getTextFor", () => {
describe("in a room that should be prefixed (non-DM)", () => {
it("returns 'You started a call' when the event is from self", () => {
const selfUserId = MatrixClientPeg.safeGet().getSafeUserId();
const event = mkEvent({
event: true,
type: "m.call.invite",
content: {},
user: selfUserId,
room: roomId,
});
expect(preview.getTextFor(event)).toBe("You started a call");
});
it("returns '<sender> started a call' when the event is from someone else", () => {
const otherUserId = "@other:example.com";
const event = mkEvent({
event: true,
type: "m.call.invite",
content: {},
user: otherUserId,
room: roomId,
});
expect(preview.getTextFor(event)).toBe(`${otherUserId} started a call`);
});
});
describe("in a DM room (should not be prefixed)", () => {
beforeEach(() => {
const cli = MatrixClientPeg.safeGet();
// Make a 1:1 room so shouldPrefixMessagesIn returns false
const room = new Room(roomId, cli, cli.getSafeUserId());
jest.spyOn(room.currentState, "getJoinedMemberCount").mockReturnValue(2);
mocked(cli.getRoom).mockReturnValue(room);
});
afterEach(() => {
mocked(MatrixClientPeg.safeGet().getRoom).mockReturnValue(null);
});
it("returns 'Waiting for answer' when the event is from self", () => {
const selfUserId = MatrixClientPeg.safeGet().getSafeUserId();
const event = mkEvent({
event: true,
type: "m.call.invite",
content: {},
user: selfUserId,
room: roomId,
});
expect(preview.getTextFor(event, DefaultTagID.DM)).toBe("Waiting for answer");
});
it("returns '<sender> is calling' when the event is from someone else", () => {
const otherUserId = "@other:example.com";
const event = mkEvent({
event: true,
type: "m.call.invite",
content: {},
user: otherUserId,
room: roomId,
});
expect(preview.getTextFor(event, DefaultTagID.DM)).toBe(`${otherUserId} is calling`);
});
});
});
});

View File

@ -8,7 +8,8 @@ Please see LICENSE files in the repository root for full details.
import { RelationType } from "matrix-js-sdk/src/matrix";
import { MessageEventPreview } from "../../../../../src/stores/room-list/previews/MessageEventPreview";
// Import directly from the file to avoid circular dependencies with MessagePreviewStore
import { MessageEventPreview } from "../../../../../src/stores/message-preview/previews/MessageEventPreview";
import { mkEvent, stubClient } from "../../../../test-utils";
describe("MessageEventPreview", () => {

View File

@ -8,7 +8,8 @@ Please see LICENSE files in the repository root for full details.
import { type MatrixClient } from "matrix-js-sdk/src/matrix";
import { PollStartEventPreview } from "../../../../../src/stores/room-list/previews/PollStartEventPreview";
// Import directly from the file to avoid circular dependencies with MessagePreviewStore
import { PollStartEventPreview } from "../../../../../src/stores/message-preview/previews/PollStartEventPreview";
import { MatrixClientPeg } from "../../../../../src/MatrixClientPeg";
import { makePollStartEvent } from "../../../../test-utils";

View File

@ -10,7 +10,8 @@ import { RelationType, Room, RoomMember } from "matrix-js-sdk/src/matrix";
import { mocked } from "jest-mock";
import { mkEvent, stubClient } from "../../../../test-utils";
import { ReactionEventPreview } from "../../../../../src/stores/room-list/previews/ReactionEventPreview";
// Import directly from the file to avoid circular dependencies with MessagePreviewStore
import { ReactionEventPreview } from "../../../../../src/stores/message-preview/previews/ReactionEventPreview";
import { MatrixClientPeg } from "../../../../../src/MatrixClientPeg";
describe("ReactionEventPreview", () => {

View File

@ -0,0 +1,115 @@
/*
* Copyright 2026 Element Creations Ltd.
*
* SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
* Please see LICENSE files in the repository root for full details.
*/
import { Room } from "matrix-js-sdk/src/matrix";
import { mocked } from "jest-mock";
import { StickerEventPreview } from "../../../../../src/stores/message-preview/previews/StickerEventPreview";
import { DefaultTagID } from "../../../../../src/stores/room-list-v3/skip-list/tag";
import { mkEvent, stubClient } from "../../../../test-utils";
import { MatrixClientPeg } from "../../../../../src/MatrixClientPeg";
describe("StickerEventPreview", () => {
const preview = new StickerEventPreview();
const roomId = "!room:example.com";
beforeAll(() => {
stubClient();
});
describe("getTextFor", () => {
it("returns null when the event has no body", () => {
const event = mkEvent({
event: true,
type: "m.sticker",
content: {},
user: "@other:example.com",
room: roomId,
});
expect(preview.getTextFor(event)).toBeNull();
});
it("returns null when the body is an empty string", () => {
const event = mkEvent({
event: true,
type: "m.sticker",
content: { body: "" },
user: "@other:example.com",
room: roomId,
});
expect(preview.getTextFor(event)).toBeNull();
});
describe("in a room that should be prefixed (non-DM)", () => {
// Default stub: getRoom returns null → shouldPrefixMessagesIn returns true
it("returns '<sender>: <stickerName>' when the event is from someone else", () => {
const otherUserId = "@other:example.com";
const event = mkEvent({
event: true,
type: "m.sticker",
content: { body: "wave" },
user: otherUserId,
room: roomId,
});
expect(preview.getTextFor(event)).toBe(`${otherUserId}: wave`);
});
it("returns just the sticker name when the event is from self", () => {
const selfUserId = MatrixClientPeg.safeGet().getSafeUserId();
const event = mkEvent({
event: true,
type: "m.sticker",
content: { body: "wave" },
user: selfUserId,
room: roomId,
});
expect(preview.getTextFor(event)).toBe("wave");
});
});
describe("in a DM room (should not be prefixed)", () => {
beforeEach(() => {
const cli = MatrixClientPeg.safeGet();
// Make a 1:1 room so shouldPrefixMessagesIn returns false
const room = new Room(roomId, cli, cli.getSafeUserId());
jest.spyOn(room.currentState, "getJoinedMemberCount").mockReturnValue(2);
mocked(cli.getRoom).mockReturnValue(room);
});
afterEach(() => {
mocked(MatrixClientPeg.safeGet().getRoom).mockReturnValue(null);
});
it("returns just the sticker name regardless of sender", () => {
const otherUserId = "@other:example.com";
const event = mkEvent({
event: true,
type: "m.sticker",
content: { body: "wave" },
user: otherUserId,
room: roomId,
});
expect(preview.getTextFor(event, DefaultTagID.DM)).toBe("wave");
});
});
describe("in a thread", () => {
it("returns just the sticker name regardless of sender", () => {
const otherUserId = "@other:example.com";
const event = mkEvent({
event: true,
type: "m.sticker",
content: { body: "wave" },
user: otherUserId,
room: roomId,
});
expect(preview.getTextFor(event, undefined, true)).toBe("wave");
});
});
});
});

View File

@ -19,7 +19,7 @@ import { createTestClient, flushPromises } from "../../test-utils";
import { RoomNotificationState } from "../../../src/stores/notifications/RoomNotificationState";
import { RoomNotificationStateStore } from "../../../src/stores/notifications/RoomNotificationStateStore";
import { NotificationStateEvents } from "../../../src/stores/notifications/NotificationState";
import { type MessagePreview, MessagePreviewStore } from "../../../src/stores/room-list/MessagePreviewStore";
import { type MessagePreview, MessagePreviewStore } from "../../../src/stores/message-preview";
import { UPDATE_EVENT } from "../../../src/stores/AsyncStore";
import SettingsStore from "../../../src/settings/SettingsStore";
import DMRoomMap from "../../../src/utils/DMRoomMap";