Implement broadcast message preview (#9762)

This commit is contained in:
Michael Weimann 2022-12-16 12:01:16 +01:00 committed by GitHub
parent 6205c70462
commit 51554399fb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 353 additions and 32 deletions

View file

@ -32,6 +32,8 @@ import { StickerEventPreview } from "./previews/StickerEventPreview";
import { ReactionEventPreview } from "./previews/ReactionEventPreview";
import { UPDATE_EVENT } from "../AsyncStore";
import { IPreview } from "./previews/IPreview";
import { VoiceBroadcastInfoEventType } from "../../voice-broadcast";
import { VoiceBroadcastPreview } from "./previews/VoiceBroadcastPreview";
// Emitted event for when a room's preview has changed. First argument will the room for which
// the change happened.
@ -76,6 +78,10 @@ const PREVIEWS: Record<
isState: false,
previewer: new PollStartEventPreview(),
},
[VoiceBroadcastInfoEventType]: {
isState: true,
previewer: new VoiceBroadcastPreview(),
},
};
// The maximum number of events we're willing to look back on to get a preview.