telegram icon indicating copy to clipboard operation
telegram copied to clipboard

Events with empty body aren't bridged

Open q234rty opened this issue 2 years ago • 3 comments

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

q234rty avatar Sep 09 '23 11:09 q234rty

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

maltee1 avatar Sep 09 '23 11:09 maltee1

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.

q234rty avatar Sep 09 '23 12:09 q234rty

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.

maltee1 avatar Sep 09 '23 12:09 maltee1