-
Notifications
You must be signed in to change notification settings - Fork 201
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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]>
- Loading branch information
Showing
2 changed files
with
48 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters