add Ended poll text to ended poll reply formatted body (#10146)

This commit is contained in:
Kerry 2023-02-14 11:34:47 +13:00 committed by GitHub
parent 3eee91d4ed
commit b4565f5024
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 28 additions and 0 deletions

View file

@ -20,6 +20,7 @@ import escapeHtml from "escape-html";
import { THREAD_RELATION_TYPE } from "matrix-js-sdk/src/models/thread";
import { MsgType } from "matrix-js-sdk/src/@types/event";
import { M_BEACON_INFO } from "matrix-js-sdk/src/@types/beacon";
import { M_POLL_END } from "matrix-js-sdk/src/@types/polls";
import { PERMITTED_URL_SCHEMES } from "../HtmlUtils";
import { makeUserPermalink, RoomPermalinkCreator } from "./permalinks/Permalinks";
@ -110,6 +111,15 @@ export function getNestedReplyText(
};
}
if (M_POLL_END.matches(ev.getType())) {
return {
html:
`<mx-reply><blockquote><a href="${evLink}">In reply to</a> <a href="${userLink}">${mxid}</a>` +
`<br>Ended poll</blockquote></mx-reply>`,
body: `> <${mxid}>Ended poll\n\n`,
};
}
// This fallback contains text that is explicitly EN.
switch (msgtype) {
case MsgType.Text: