Open maximmax42 opened 1 year ago
I'll look into this on my end. I will have to verify the API response because when this was first implemented it was byte count.
Yeah, it was probably changed, and it's not mentioned anywhere. Old page for this API still says 128 bytes, but it also says image names can be no more than 32 bytes, which we know isn't true anymore.
Oh and also, API doesn't accept text fields that are exactly 1 character, needs to be 2 or more.
An update: while button labels accept 32 any characters even if it's more than 32 bytes, putting a label with 32+ bytes still causes the whole presence to not show for others.
Discord Moment:tm:
Consider this string of 128 Cyrillic letters а:![image](https://user-images.githubusercontent.com/2225711/202428303-4fc9bb76-4d20-49d4-90d2-5e3d0b92ffbb.png)
аааааааааааааааааааааааааааааааааааааааааааааааааааааааааааааааааааааааааааааааааааааааааааааааааааааааааааааааааааааааааааааааа
Counting in UTF-8 bytes, it's 256 bytes long, and yet, if I replace byte check in the library with a simple length comparison, it works just fine:Here's a string that has 64 Cyrillic а's and 64 Latin b's:![image](https://user-images.githubusercontent.com/2225711/202429053-dc11e15a-7cd5-44cf-9749-f7acc8098955.png)
ааааааааааааааааааааааааааааааааааааааааааааааааааааааааааааааааbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
Byte length would be 192, but character length is still 128, so it also works just fine:I've also tested if other people see the presence with those strings, and they do.
Thought up of another test, Zalgo. Consider this string: GitHub removes Zalgo text so here's a link to the string instead 206 bytes, 110 characters. Under 128 character, so it works:![image](https://user-images.githubusercontent.com/2225711/202431398-346fb7ba-707c-4e8f-9d94-4255230816e4.png)