mirror of
https://github.com/element-hq/element-web.git
synced 2024-12-04 22:00:42 +03:00
Add sticker support
This commit is contained in:
parent
fc61e96218
commit
01a3b854c3
1 changed files with 9 additions and 15 deletions
|
@ -246,21 +246,15 @@ export default class HTMLExporter extends Exporter {
|
||||||
|
|
||||||
protected async createMessageBody(mxEv: MatrixEvent, joined = false) {
|
protected async createMessageBody(mxEv: MatrixEvent, joined = false) {
|
||||||
let eventTile: JSX.Element;
|
let eventTile: JSX.Element;
|
||||||
switch (mxEv.getContent().msgtype) {
|
const attachmentTypes = ["m.sticker", "m.image", "m.file", "m.video", "m.audio"]
|
||||||
case "m.image":
|
|
||||||
case "m.file":
|
if (mxEv.getType() === attachmentTypes[0] || attachmentTypes.includes(mxEv.getContent().msgtype)) {
|
||||||
case "m.video":
|
const blob = await this.getMediaBlob(mxEv);
|
||||||
case "m.audio": {
|
const filePath = this.getFilePath(mxEv);
|
||||||
const blob = await this.getMediaBlob(mxEv);
|
eventTile = this.getEventTile(mxEv, joined, filePath);
|
||||||
const filePath = this.getFilePath(mxEv);
|
this.zip.file(filePath, blob);
|
||||||
eventTile = this.getEventTile(mxEv, joined, filePath);
|
} else eventTile = this.getEventTile(mxEv, joined);
|
||||||
this.zip.file(filePath, blob);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
eventTile = this.getEventTile(mxEv, joined);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return renderToStaticMarkup(eventTile);
|
return renderToStaticMarkup(eventTile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue