Render captions to m.file, m.image, m.video, and m.audio (#2059)
authornexy7574 <me@nexy7574.co.uk>
Mon, 6 Jan 2025 01:44:22 +0000 (01:44 +0000)
committerGitHub <noreply@github.com>
Mon, 6 Jan 2025 01:44:22 +0000 (12:44 +1100)
commit02437a6a20d5e1cc139c3953a57c37c911f70612
treec7915a3648491fee23f4332ceef71b14232f0e9e
parent3c5afaf33a827f85e2bbf70f7b458c038930bd64
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>
src/app/components/RenderMessageContent.tsx
src/app/components/message/MsgTypeRenderers.tsx
src/app/features/room/msgContent.ts
src/types/matrix/common.ts