reddit-moderator-toolbox
reddit-moderator-toolbox copied to clipboard
Modbutton ban message can become too long when expanding tokens
When using the mod button to issue a ban, using repeated tokens in the message (e.g. {body}{body}{body}) can cause the final message's length to exceed the 1000 character cap, circumventing the maxlength on the text field and resulting in the ban not going through. We should expand tokens, check the message length, and if it exceeds the character limit, display the full message to let the user edit it down within the character limit before sending the ban.
Similar bugs probably exist in other places where tokens can be used as well. Might be worth making the solution to this a TBui routine for reusability.
rel #379
We already have a substring for message in TBApi though, it shouldn't cause any issues with the request
https://github.com/toolbox-team/reddit-moderator-toolbox/blob/7a67e74379f4477fb6e83f597ae56fdbe3f6ac67/extension/data/tbapi.js#L381-L391
huh... that's very strange, I was troubleshooting an issue on Discord the other day that the user said was solved by making the reason shorter... I'll have to look into this further.