element-hq / element-x-android

Android Matrix messenger application using the Matrix Rust Sdk and Jetpack Compose
GNU Affero General Public License v3.0
973 stars 130 forks source link

Certain types of images does not render on chat room #1874

Open olmari opened 9 months ago

olmari commented 9 months ago

Steps to reproduce

  1. Receive an "telegram custom emoji" in an room where telegram bridge and thus telegram users exist.
  2. Observe blank message in EXA, whereas old EA and Element-desktop shows something.

Outcome

What did you expect?

As this "telegram custom emoji" is after all an html image tag in matrix-perspective, I expect to see the image, or at least the "alternative" normal emoji the hinting also provides with (unformatted) body and img alt tag.

What happened instead?

Seeing blank message.

Exploration from data, for the message screenshots there are 2 messages, first one is reply to an image in an room, the very next one is separate "normal" message through bridge.

First an screenshot from Element Desktop, somewhat the "this is how it should look": 1

Then screenshot from EXA: 2

Also as an mention, EXAs orooms list that shows latest message preview which was the then latest "telegram custom emoji", this shows the "alternate" picture / emoji message also provides: 3

Bonus mention, no screenshot: EA shows the "alt" emojis in the room, which is at least something, but generally the actual provided images should be shown in EXA too like they do in Element Desktop.

Both events with some private data redacted:

{
  "content": {
    "body": "> <geezetatee> an image\n\n😜",
    "external_url": "hps//t.me/c/<number>",
    "fi.mau.telegram.source": {
      "chat_id": <number>,
      "id": <number>,
      "peer_type": "channel",
      "space": <number>
    },
    "format": "org.matrix.custom.html",
    "formatted_body": "<mx-reply><blockquote><a href='https://matrix.to/#/<redacted>:hacklab.fi/$wYakXVI-Tz2boVDsxme_ccfUfYWF5E2NryHBdft8qO8'>In reply to</a> <a href='https://matrix.to/#/@_telegram_<redacted>:hacklab.fi'>geezetatee</a><br/>sent an image</blockquote></mx-reply><img data-mx-emoticon data-mau-animated-emoji src=\"mxc://hacklab.fi/WwTkTUioUhNFNTMEYdXeVfyZ\" height=\"32\" width=\"32\" alt=\"😜\" title=\"😜\"/>",
    "m.relates_to": {
      "m.in_reply_to": {
        "event_id": "$wYakXVI-Tz2boVDsxme_ccfUfYWF5E2NryHBdft8qO8"
      }
    },
    "msgtype": "m.text"
  },
  "origin_server_ts": 1700747424000,
  "sender": "@_telegram_<redacted>:hacklab.fi",
  "type": "m.room.message",
  "unsigned": {
    "age": 253
  },
  "event_id": "$snV_ryDpYRTNSHv1Oj1CKzSkygkQdccpXkJr0FHnBW0",
  "room_id": "!exOOKPUBQshGCgBufD:hacklab.fi"
}

and

  {
  "content": {
    "body": "πŸ‘",
    "external_url": "https://t.me/c/<number>",
    "fi.mau.telegram.source": {
      "chat_id": <number>,
      "id": <number>,
      "peer_type": "channel",
      "space": <number>
    },
    "format": "org.matrix.custom.html",
    "formatted_body": "<img data-mx-emoticon data-mau-animated-emoji src=\"mxc://hacklab.fi/xhswfRnWjgXNNgVXMkzvEwIg\" height=\"32\" width=\"32\" alt=\"πŸ‘\" title=\"πŸ‘\"/>",
    "msgtype": "m.text"
  },
  "origin_server_ts": 1700747431000,
  "sender": "@_telegram_<number>:hacklab.fi",
  "type": "m.room.message",
  "unsigned": {
    "age": 112
  },
  "event_id": "$MVSoKkzgZqEgt3gUiAJV-TJI718OZpJ-9CpKuDflQGY",
  "room_id": "!exOOKPUBQshGCgBufD:hacklab.fi"
}

Your phone model

Planet Computers Astro Slider

Operating system version

Andoid 11

Application version and app store

0.3.4-nightly (4003040)

Homeserver

Hacklab.fi Synapse 1.96.1

Will you send logs?

No

Are you willing to provide a PR?

No

vincejv commented 3 months ago

Issue seems like the app isn't capable of rendering mxc:// images, happening with Element X for iOS as well

jmartinesp commented 3 months ago

Issue seems like the app isn't capable of rendering mxc:// images, happening with Element X for iOS as well

Not exactly. We can render mxc images (avatars, attachments, etc.) but we can't do it at the moment inside messages with the <img> HTML tag. So it's actually more a missing feature than a bug.