No Chat Reports

No Chat Reports

43M Downloads

Enforce encryption chat length clientside

Madis0 opened this issue ยท 1 comments

commented

Idea

Because encrypted messages do increase the length of the message, it should also limit the new character count the player can send in the first place to avoid getting part of the message cut. This should apply only to cases that have the limits in the first place, aka public chats or private messages, depending on which ones are enabled.

I guess the easiest (not necessarily fastest) way to do that would be to:

  1. detect whether the player is typing an encryptable message
  2. encrypt the message on every character change
  3. see if encrypted message <= 256

Alternatively, continue encrypting on send and show some kind of error when sending a too long message.

Reasoning

Because then the player knows how much they can really type, instead of getting a part of the message cut.

Other Information

P.S. Don't rely on any chat preview code for this, as that is getting removed in 1.19.3 lol

commented

It should be optional, because your computer must encrypt the message real-time. This may make it difficult to run smoothly on low configuration devices.