mautrix / telegram

A Matrix-Telegram hybrid puppeting/relaybot bridge
https://matrix.to/#/#telegram:maunium.net
GNU Affero General Public License v3.0
1.34k stars 175 forks source link

Events with empty body aren't bridged #930

Open q234rty opened 1 year ago

q234rty commented 1 year ago

Bridging m.image or m.sticker events with body: "" fails.

To reproduce

  1. Craft and send an m.image event with body: ""
  2. Notice that the image is not bridged to telegram
maltee1 commented 1 year ago

If I understand correctly, an empty body violates the spec. The bridge is right for dropping messages with an empty body.

q234rty commented 1 year ago

The spec says the body key is required, but did not explicitly say it must be non-empty. In fact, some "required" fields in the spec are allowed to be empty strings.

maltee1 commented 1 year ago

It doesn't explicitly say so, but it pretty much implies it:

"The body key is text and MUST be used with every kind of msgtype as a fallback mechanism for when a client cannot render a message. This allows clients to display something even if it is just plain text."

There's nothing to display if body is empty, I therefore conclude that the field must not be empty. This should probably be clarified in the spec to be more obvious.