You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Starting with Client-Server API v1.10 [0], the `body` field in messages of type `m.image`,
`m.audio`, `m.video` and `m.file` can be used as the caption of the attachment. This is fact the way
that Nheko rends captions on images, for example.
This commit introduces a field in the `UploadHandle`s awaiting upload on the timeline's `InputBar`
which holds a caption taken from the input text area. The decision is as follows:
- If text bar is empty or full of blanks, send all media with no caption
- If the text is an incomplete command, fail
- If there are no pending uploads, proceed as done previously (if there is no command recognized
send the text, or try and execute the command and if it fails send the text)
- If there are pending uploads, only accept uploads if nothing resembling a command name is in the
text area. That text becomes the caption for all pending media. Otherwise, try and execute the
command, and, if it fails, send it as text.
While this workflow for captioning so far is a bit jank, it is the least effort implementation.
Links:
[0]: https://spec.matrix.org/v1.10/client-server-api/#mimage
Signed-off-by: lymkwi <[email protected]>
0 commit comments