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

Character limit calculated wrong on CW replies #815

Closed
BDGreyson opened this issue Jul 13, 2024 · 1 comment · Fixed by #821
Closed

Character limit calculated wrong on CW replies #815

BDGreyson opened this issue Jul 13, 2024 · 1 comment · Fixed by #821

Comments

@BDGreyson
Copy link

Describe the bug
When REPLYING to Toots with content warnings the characters taken up by the warning are not counted towards the character limit, thus causing errors when posting.

To Reproduce

  1. Create a text that has exactly as many characters as the server limit
  2. Create a post with a content warning
  3. Paste the exact-limit text in a reply to the post where the reply automatically copies the CW of the original Toot
  4. Sending fails because full-limit text + the original CW go over the server limit

Expected behavior
As soon as the reply is started, the characters in the CW that the reply automatically adds from the original post needs to be substracted from the "remaining characters" count

Versions
Pachli 2.6.0 (F-Droid)
Google Pixel 7
Android 14
SDK 34

Mastodon Server version: 4.2.10

Affirmation
X I have checked other issues for this project (open and closed) and I cannot find one that matches the problem I am reporting.

@BDGreyson BDGreyson changed the title Character limit calculated wrong on CW replied Character limit calculated wrong on CW replies Jul 13, 2024
nikclayton added a commit to nikclayton/pachli-android that referenced this issue Jul 14, 2024
…rning

Previous code set `doOnTextChanged` listener for the content warning
*after* the initial value had been set. This meant the initial content
warning text was not included when calculating the status' initial
length.

Fix that by setting the listener before the text is set.

Fixes pachli#815
@nikclayton
Copy link
Contributor

Thanks for the report, and sorry about that. I've found and fixed the problem, it'll be included in the Pachli release at the end of this month.

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

Successfully merging a pull request may close this issue.

2 participants