element-hq / element-hq/element-android
HTML-formatted Media Captions not supported by Element-Android client
- Dominant language
- Kotlin
- Stars
- 3.7k
- Forks
- 917
- PR merge metrics
- No merged PRs in 30d
Description
### Steps to reproduce
### HTML-formatted Media Captions not supported by Element-Android client
The Client-Server-API describes in chapter 10.2.2.7 how to set up captions for media
https://spec.matrix.org/unstable/client-server-api/#media-captions
After solution of [Issue 27927](https://github.com/element-hq/element-web/issues/27927) Element/Web and Element/Windows are supporting unformatted and HTML-formatted captions.
IOS and Android clients currently do not support captions.
The tests were performed in the following environments:
Element Desktop on Windows 10 pro 22H2 (Build 19045.4780)
Version von Element: 1.11.83
Krypto-Version: Rust SDK 0.7.2 (7a21514), Vodozemac 0.7.0
Element Android client
Element 1.6.20 [40106202] (G-fca16b67)
Matrix SDK 1.6.20 (fca16b67)
Rust SDK 0.7.0 (fa55445), Vodozemac 0.6.0
The following server and user environment was used:
```
user_name: Ranner
user_id: @e1035z:matrix.org
room_name: Bilder kommentieren
room_id: !zfSEtmLSSvPqhEhQbd:matrix.org
```
The generation of events was performed with Python scripts using matrix-nio
Results for **Element/Windows** and **Element/Web** are now as **expected**: the image is shown with a formatted caption.
Result for **Element/Android** is **unexpected**: the image is shown without any caption.

The sources for these events are nearly identical:
**Element/Windows**
```
{
"content": {
"body": "Fotograf 3871: e-Wald",
"filename": "WP2024-06_e-Wald_[Ranner]_IMG_3871.jpg",
"format": "org.matrix.custom.html",
"formatted_body": "
Fotograf 3871: e-Wald
","info": {
"h": 427,
"mimetype": "image/jpeg",
"size": 264763,
"thumbnail_info": null,
"thumbnail_url": null,
"w": 640
},
"msgtype": "m.image",
"url": "mxc://matrix.org/EtSVRTpGdgvKiOtvFxKHlRBp"
},
"origin_server_ts": 1730325027658,
"sender": "@e1035z:matrix.org",
"type": "m.room.message",
"unsigned": {
"membership": "join",
"age": 474821495
},
"event_id": "$JgsmYPGa2LokD-CEfLOvie2PuMXp3cp4rShyAmp1UxM",
"room_id": "!zfSEtmLSSvPqhEhQbd:matrix.org"
}
```
**Element/Android**
```
{
"type": "m.room.message",
"event_id": "$JgsmYPGa2LokD-CEfLOvie2PuMXp3cp4rShyAmp1UxM",
"content": {
"body": "Fotograf 3871: e-Wald",
"filename": "WP2024-06_e-Wald_[Ranner]_IMG_3871.jpg",
"format": "org.matrix.custom.html",
"formatted_body": "
Fotograf 3871: e-Wald
","info": {
"h": 427,
"mimetype": "image/jpeg",
"size": 264763,
"w": 640
},
"msgtype": "m.image",
"url": "mxc://matrix.org/EtSVRTpGdgvKiOtvFxKHIRBp"
},
"origin_server_ts": 1730325027658,
"sender": "@e1035z:matrix.org",
"room_id": "!zfSEtmLSSvPqhEhQbd:matrix.org",
"unsigned": {
"age": 2588
}
}
```
A support of formatted captions for Element/Android client like Element/Windows and Element/Web would be highly appreciated.
### Outcome
#### What did you expect?
Display of image with formatted caption
#### What happened instead?
Display of image without any caption
### Your phone model
_No response_
### Operating system version
_No response_
### Application version and app store
1.6.20 [40106202] (G-fca16b67)
### Homeserver
matrix.org
### Will you send logs?
No
### Are you willing to provide a PR?
Yes
Contributor guide
Assessment
This issue has not been assessed yet.