diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2016-05-28 23:13:47 +0200 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2016-05-28 23:13:47 +0200 |
commit | 422fd1847fa18553398a2747c72f835d9227f172 (patch) | |
tree | 1487e9fd7c91da65ec59421d225252d7aaac32fe /src/main/java/eu/siacs/conversations/ui/adapter | |
parent | ce0888b07763c89f1b204cba7d40cb3020a2ac88 (diff) |
only rendering first 5k chars of each message
Diffstat (limited to 'src/main/java/eu/siacs/conversations/ui/adapter')
-rw-r--r-- | src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java b/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java index 74bfb491a..32646a92d 100644 --- a/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java +++ b/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java @@ -19,6 +19,7 @@ import android.text.style.RelativeSizeSpan; import android.text.style.StyleSpan; import android.text.util.Linkify; import android.util.DisplayMetrics; +import android.util.Log; import android.util.Patterns; import android.view.View; import android.view.View.OnClickListener; @@ -39,6 +40,7 @@ import java.util.regex.MatchResult; import java.util.regex.Matcher; import java.util.regex.Pattern; +import eu.siacs.conversations.Config; import eu.siacs.conversations.R; import eu.siacs.conversations.crypto.axolotl.XmppAxolotlSession; import eu.siacs.conversations.entities.Account; @@ -308,6 +310,10 @@ public class MessageAdapter extends ArrayAdapter<Message> { } catch (ArrayIndexOutOfBoundsException e) { body = message.getMergedBody(); } + if (body.length() > Config.MAX_DISPLAY_MESSAGE_CHARS) { + Log.d(Config.LOGTAG,"not showing complete message of length "+body.length()); + body = body.substring(0, Config.MAX_DISPLAY_MESSAGE_CHARS); + } final SpannableString formattedBody = new SpannableString(body); int i = body.indexOf(Message.MERGE_SEPARATOR); while(i >= 0) { |