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

Fix for #469 compose shows error now when length too long #471

Closed
wants to merge 1 commit into from

Conversation

danschwarz
Copy link
Collaborator

No description provided.

@danschwarz danschwarz self-assigned this Mar 3, 2024
@danschwarz danschwarz requested a review from ihabunek March 3, 2024 19:42
@ihabunek
Copy link
Owner

ihabunek commented Mar 9, 2024

@danschwarz I don't want to do this because we don't always detect max length correctly, and I don't want the user not to be able to send a longer message just because fail at this.

Besides, calculating max length is more involved than just len(content), beucause you need to take into account links which are shortened by the server.

If you look at https://mastodon.social/api/v1/instance you'll see characters_reserved_per_url:

{
  "configuration": {
    "statuses": {
      "max_characters": 500,
      "max_media_attachments": 4,
      "characters_reserved_per_url": 23
    }
}

A better fix would be to catch the exception when posting and display the error to the user.

@ihabunek ihabunek closed this Mar 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants