-
-
Notifications
You must be signed in to change notification settings - Fork 262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add captions to m.file, m.image, m.video, and m.audio #2059
base: dev
Are you sure you want to change the base?
Conversation
All contributors have signed the CLA ✍️ ✅ |
I have read the CLA Document and I hereby sign the CLA |
Preview: https://2059--pr-cinny.netlify.app |
+ Fix video and audio not properly sending captions
src/app/features/room/RoomInput.tsx
Outdated
const contentsPromises = uploads.map(async (upload) => { | ||
const fileItem = selectedFiles.find((f) => f.file === upload.file); | ||
if (!fileItem) throw new Error('Broken upload'); | ||
const caption = toPlainText(editor.children).trim() || undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like following changes add same caption to multiple uploaded file. Do we really want that? Can't we just send it as separate in that case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it not be better to attach the caption to the last uploaded item, rather than as an entirely separate message?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As nice as that would be, would it not require adding another message composer, especially since both html and plaintext are meant to be supported? How would that work on mobile?
Apologies for the delay, my hands are quite full until Febuary 😔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah adding full message composer won't be a good idea, but maybe we can add plaintext caption as file rename option, not sure about how that would go. So if we don't want to go with sending caption from main composer yet could we please limit this PR for display only support as that alone would be really helpful.
mx.sendMessage(roomId, content); | ||
if (!uploadBoardHandlers.current) { | ||
mx.sendMessage(roomId, content); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will be a good idea if we can extract the content
generation process in separate function so it can be used here and for caption.
Description
This PR will introduce both rendering & sending file captions.
These were introduced in spec v1.10, and have recently seen wide adoption amongst Element and other clients. It is time that cinny had this too.
Fixes #1646
Type of change
Checklist: