elk-zone / elk

A nimble Mastodon web client
https://elk.zone
MIT License
5.41k stars 557 forks source link

The instance character limit is not respected when connecting to Pleroma/Akkoma #2573

Open blacklight opened 8 months ago

blacklight commented 8 months ago

Most of the Pleroma/Akkoma instances allow longer posts than Mastodon (the character limit is 5000 by default).

However, for some reason Elk seems to ignore the configured maximum post size when I connect to my personal instance, and it'll always show 500 as a maximum number of allowed characters.

stackblitz[bot] commented 8 months ago

Solve in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.

blacklight commented 8 months ago

One more detail: Elk allows me to submit the post anyway, even if longer than 500 characters.

The character count on the UI is red and the submit button is grayed out, but upon click the request is submitted to the server anyway and it succeeds.

shuuji3 commented 7 months ago

I looked into the instance API endpoint for Akkoma. It looks like Akkoma publishes the maximum character limit but doesn't publish it the same way as Mastodon does.

Mastodon instance has configuration.statuses.max_characters key, which is the value Elk is reading to determine the maximum characters:

https://mastodon.social/api/v1/instance

{
  ...
  "configuration": {
    "accounts": {
      "max_featured_tags": 10
    },
    "statuses": {
      "max_characters": 500,
      "max_media_attachments": 4,
      "characters_reserved_per_url": 23
    },
  ...
}

But Akkoma uses the custom key name differently:

https://seafoam.space/api/v1/instance

{
  ...
  "max_toot_chars": 5000,
  ...
}
shuuji3 commented 7 months ago

I made a feature request to implement the configuration property for Akkoma: https://akkoma.dev/AkkomaGang/akkoma/issues/696