forked from mirror/monocles_chat_clean
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:
parent
122ff3f881
commit
a2339e15a0
1 changed files with 4 additions and 0 deletions
|
@ -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))) {
|
||||
|
|
Loading…
Reference in a new issue