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 <lymkwi@vulpinecitrus.info>
- The translation key needs the .qm files to be included to work (so it's useless right now; the CMake
script needs to be adjusted to install those files and make this key work properly)
- The Purism custom keys don't seem to be relevant anymore (so that's another useless thing)
- The donation key needs an URL to be useful (the FIXME is still left so it can be readded later)
There is no use case for those afaik and they do break our replacement
in the frontend. Let's instead strip them out in the sanitization step,
since there are no valid attributes defined for the del tag currenlty.
In theory we could also strip out all attributes here, but that seems
excessive for now.
Fixes https://github.com/Nheko-Reborn/nheko/issues/1693
Currently translated at 85.2% (893 of 1047 strings)
Translated using Weblate (Polish)
Currently translated at 85.2% (893 of 1047 strings)
Co-authored-by: Przemysław Romanik <github@rom4nik.pl>
Co-authored-by: Weblate <noreply@weblate.org>
Translate-URL: https://weblate.nheko.im/projects/nheko/nheko-master/pl/
Translation: Nheko/nheko
Currently translated at 100.0% (1047 of 1047 strings)
Translated using Weblate (Dutch)
Currently translated at 100.0% (1047 of 1047 strings)
Translated using Weblate (Dutch)
Currently translated at 93.2% (976 of 1047 strings)
Co-authored-by: Jaron Viëtor <jaron@v8or.nl>
Co-authored-by: Ruben De Smet <ruben.de.smet@rubdos.be>
Co-authored-by: Weblate <noreply@weblate.org>
Translate-URL: https://weblate.nheko.im/projects/nheko/nheko-master/nl/
Translation: Nheko/nheko
Currently translated at 100.0% (1047 of 1047 strings)
Translated using Weblate (Esperanto)
Currently translated at 99.5% (1042 of 1047 strings)
Translated using Weblate (Esperanto)
Currently translated at 99.5% (1042 of 1047 strings)
Translated using Weblate (Esperanto)
Currently translated at 98.2% (1029 of 1047 strings)
Translated using Weblate (Esperanto)
Currently translated at 96.7% (1013 of 1047 strings)
Translated using Weblate (Esperanto)
Currently translated at 93.6% (980 of 1047 strings)
Translated using Weblate (Esperanto)
Currently translated at 87.1% (912 of 1047 strings)
Co-authored-by: DeepBlueV7.X <nicolas.werner@hotmail.de>
Co-authored-by: Tirifto <tirifto@posteo.cz>
Co-authored-by: Weblate <noreply@weblate.org>
Translate-URL: https://weblate.nheko.im/projects/nheko/nheko-master/eo/
Translation: Nheko/nheko
Currently translated at 100.0% (1047 of 1047 strings)
Co-authored-by: Priit Jõerüüt <nhkwlate@joeruut.com>
Co-authored-by: Weblate <noreply@weblate.org>
Translate-URL: https://weblate.nheko.im/projects/nheko/nheko-master/et/
Translation: Nheko/nheko