Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Events with empty body aren't bridged #930

Open
q234rty opened this issue Sep 9, 2023 · 3 comments
Open

Events with empty body aren't bridged #930

q234rty opened this issue Sep 9, 2023 · 3 comments

Comments

@q234rty
Copy link

q234rty commented Sep 9, 2023

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
Copy link
Contributor

maltee1 commented Sep 9, 2023

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

@q234rty
Copy link
Author

q234rty commented Sep 9, 2023

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
Copy link
Contributor

maltee1 commented Sep 9, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants