metabolist / metatext

A free, open-source iOS Mastodon client.
https://metabolist.org/metatext
GNU General Public License v3.0
727 stars 102 forks source link

URLs only count for 23 characters of mastodon post limit - but metatext counts them all #270

Open alexbbrown opened 1 year ago

alexbbrown commented 1 year ago

Describe the bug

From the mastodon help: URLs in text always count for 23 characters

When composing a toot in metatext it displays the toot character limit (eg500) and how many more characters you can add to your post before the limit is exceeded

but when adding a 100 character URL it subtracts 100 characters from the limit, instead of 23

unless the URL is on the first line

To Reproduce Steps to reproduce the behavior:

  1. open metatext
  2. Tap compose
  3. Observe limit 500 remaining
  4. Enter this URL
    https://www.researchgate.net/profile/Marc-Smith-12/publication/215643659/figure/fig2/AS:305995675914242@1449966462078/Microsoft-Outlook-Expresss-newsgroup-browsing-interface.png
  5. Observe remaining limit is 477
  6. Add one carriage return at the start of the toot
  7. Observe remaining limit is 322

Expected behavior subtract 23, regardless of the length of the URL

Screenshots If applicable, add screenshots to help explain your problem.

(please complete the following information):

Additional context Add any other context about the problem here.