Show poll question in message preview (#7320)

This commit is contained in:
Andy Balaam 2021-12-10 12:17:26 +00:00 committed by GitHub
parent 914b61239c
commit fc96af5014
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 137 additions and 0 deletions

View file

@ -22,6 +22,7 @@ import { ActionPayload } from "../../dispatcher/payloads";
import { AsyncStoreWithClient } from "../AsyncStoreWithClient";
import defaultDispatcher from "../../dispatcher/dispatcher";
import { MessageEventPreview } from "./previews/MessageEventPreview";
import { PollStartEventPreview } from "./previews/PollStartEventPreview";
import { TagID } from "./models";
import { CallInviteEventPreview } from "./previews/CallInviteEventPreview";
import { CallAnswerEventPreview } from "./previews/CallAnswerEventPreview";
@ -29,6 +30,7 @@ import { CallHangupEvent } from "./previews/CallHangupEvent";
import { StickerEventPreview } from "./previews/StickerEventPreview";
import { ReactionEventPreview } from "./previews/ReactionEventPreview";
import { UPDATE_EVENT } from "../AsyncStore";
import { POLL_START_EVENT_TYPE } from "../../polls/consts";
// Emitted event for when a room's preview has changed. First argument will the room for which
// the change happened.
@ -39,6 +41,10 @@ const PREVIEWS = {
isState: false,
previewer: new MessageEventPreview(),
},
[POLL_START_EVENT_TYPE.name]: {
isState: false,
previewer: new PollStartEventPreview(),
},
'm.call.invite': {
isState: false,
previewer: new CallInviteEventPreview(),