Limit size of message to send

To a size we would be willing to display at least.

(cherry picked from commit 09ba4b4914c3de47bbc5ccbaee9288fb468320b1)
This commit is contained in:
Stephen Paul Weber 2024-11-19 15:18:14 -05:00 committed by Arne
parent 122ff3f881
commit a2339e15a0

View file

@ -1183,6 +1183,10 @@ public class ConversationFragment extends XmppFragment
}
Editable body = this.binding.textinput.getText();
if (body == null) body = new SpannableStringBuilder("");
if (body.length() > Config.MAX_DISPLAY_MESSAGE_CHARS) {
Toast.makeText(activity, "Message is too long", Toast.LENGTH_SHORT).show();
return;
}
final Conversation conversation = this.conversation;
final boolean hasSubject = binding.textinputSubject.getText().length() > 0;
if (conversation == null || (body.length() == 0 && (conversation.getThread() == null || !hasSubject))) {