forked from github/cinny
Render captions to m.file, m.image, m.video, and m.audio (#2059)
* Add rendering image captions * Handle sending captions for images * Fix caption rendering on m.video and m.audio too * Remove unused renderBody() parameter * Fix m.file rendering body instead of filename where possible * Add caption rendering for generic files + Fix video and audio not properly sending captions * Use m.text for captions & render on demand * Allow custom HTML in sending captions * Don't *send* captions * mvoe content const into renderCaption() --------- Co-authored-by: Ajay Bura <32841439+ajbura@users.noreply.github.com>
This commit is contained in:
@@ -43,6 +43,7 @@ export type IThumbnailContent = {
|
||||
export type IImageContent = {
|
||||
msgtype: MsgType.Image;
|
||||
body?: string;
|
||||
filename?: string;
|
||||
url?: string;
|
||||
info?: IImageInfo & IThumbnailContent;
|
||||
file?: IEncryptedFile;
|
||||
@@ -51,6 +52,7 @@ export type IImageContent = {
|
||||
export type IVideoContent = {
|
||||
msgtype: MsgType.Video;
|
||||
body?: string;
|
||||
filename?: string;
|
||||
url?: string;
|
||||
info?: IVideoInfo & IThumbnailContent;
|
||||
file?: IEncryptedFile;
|
||||
@@ -59,6 +61,7 @@ export type IVideoContent = {
|
||||
export type IAudioContent = {
|
||||
msgtype: MsgType.Audio;
|
||||
body?: string;
|
||||
filename?: string;
|
||||
url?: string;
|
||||
info?: IAudioInfo;
|
||||
file?: IEncryptedFile;
|
||||
@@ -67,6 +70,7 @@ export type IAudioContent = {
|
||||
export type IFileContent = {
|
||||
msgtype: MsgType.File;
|
||||
body?: string;
|
||||
filename?: string;
|
||||
url?: string;
|
||||
info?: IFileInfo & IThumbnailContent;
|
||||
file?: IEncryptedFile;
|
||||
|
||||
Reference in New Issue
Block a user