diff options
author | steckbrief <steckbrief@chefmail.de> | 2019-07-07 22:42:06 +0200 |
---|---|---|
committer | steckbrief <steckbrief@chefmail.de> | 2019-07-07 22:42:06 +0200 |
commit | 811f3b092608b7c17982823b28c950489d0345e0 (patch) | |
tree | aac22cd7b960082752aa1b6a01fe793bf5dfb695 /src/main/java/de/pixart/messenger/ui/adapter | |
parent | abde267e5c1abc02ef1130f5ffd058199582926d (diff) |
implements FS#277: Remove 'Message merge'
Diffstat (limited to 'src/main/java/de/pixart/messenger/ui/adapter')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/adapter/ConversationAdapter.java | 2 | ||||
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java | 17 |
2 files changed, 8 insertions, 11 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/adapter/ConversationAdapter.java b/src/main/java/de/pixart/messenger/ui/adapter/ConversationAdapter.java index 15efb7921..b7e08addf 100644 --- a/src/main/java/de/pixart/messenger/ui/adapter/ConversationAdapter.java +++ b/src/main/java/de/pixart/messenger/ui/adapter/ConversationAdapter.java @@ -232,7 +232,7 @@ public class ConversationAdapter extends RecyclerView.Adapter<ConversationAdapte } if (activity.xmppConnectionService.indicateReceived()) { - switch (message.getMergedStatus()) { + switch (message.getStatus()) { case Message.STATUS_SEND_RECEIVED: viewHolder.binding.indicatorReceived.setVisibility(View.VISIBLE); break; diff --git a/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java b/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java index 4cdefccc3..f67ad887c 100644 --- a/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java +++ b/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java @@ -77,6 +77,7 @@ import de.pixart.messenger.utils.CryptoHelper; import de.pixart.messenger.utils.EmojiWrapper; import de.pixart.messenger.utils.Emoticons; import de.pixart.messenger.utils.GeoHelper; +import de.pixart.messenger.utils.MessageUtils; import de.pixart.messenger.utils.RichPreview; import de.pixart.messenger.utils.StylingHelper; import de.pixart.messenger.utils.UIHelper; @@ -222,7 +223,7 @@ public class MessageAdapter extends ArrayAdapter<Message> implements CopyTextVie } final Transferable transferable = message.getTransferable(); boolean multiReceived = message.getConversation().getMode() == Conversation.MODE_MULTI - && message.getMergedStatus() <= Message.STATUS_RECEIVED; + && message.getStatus() <= Message.STATUS_RECEIVED; if (message.isFileOrImage() || transferable != null) { FileParams params = message.getFileParams(); filesize = params.size > 0 ? UIHelper.filesizeToString(params.size) : null; @@ -230,7 +231,7 @@ public class MessageAdapter extends ArrayAdapter<Message> implements CopyTextVie error = true; } } - switch (message.getMergedStatus()) { + switch (message.getStatus()) { case Message.STATUS_WAITING: info = getContext().getString(R.string.waiting); break; @@ -350,7 +351,7 @@ public class MessageAdapter extends ArrayAdapter<Message> implements CopyTextVie viewHolder.indicator.setVisibility(View.VISIBLE); } - String formatedTime = UIHelper.readableTimeDifferenceFull(getContext(), message.getMergedTimeSent()); + String formatedTime = UIHelper.readableTimeDifferenceFull(getContext(), message.getTimeSent()); if (message.getStatus() <= Message.STATUS_RECEIVED) { if ((filesize != null) && (info != null)) { viewHolder.time.setText(formatedTime + " \u00B7 " + filesize + " \u00B7 " + info); @@ -532,7 +533,9 @@ public class MessageAdapter extends ArrayAdapter<Message> implements CopyTextVie viewHolder.messageBody.setTypeface(null, Typeface.NORMAL); if (message.getBody() != null) { final String nick = UIHelper.getMessageDisplayName(message); - SpannableStringBuilder body = message.getMergedBody(); + String messageBody = message.getBody(); + SpannableStringBuilder body = new SpannableStringBuilder(MessageUtils.filterLtrRtl(messageBody).trim()); + boolean hasMeCommand = message.hasMeCommand(); if (hasMeCommand) { body = body.replace(0, Message.ME_COMMAND.length(), nick); @@ -541,12 +544,6 @@ public class MessageAdapter extends ArrayAdapter<Message> implements CopyTextVie body = new SpannableStringBuilder(body, 0, Config.MAX_DISPLAY_MESSAGE_CHARS); body.append("\u2026"); } - Message.MergeSeparator[] mergeSeparators = body.getSpans(0, body.length(), Message.MergeSeparator.class); - for (Message.MergeSeparator mergeSeparator : mergeSeparators) { - int start = body.getSpanStart(mergeSeparator); - int end = body.getSpanEnd(mergeSeparator); - body.setSpan(new DividerSpan(true), start, end, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); - } boolean startsWithQuote = handleTextQuotes(body, darkBackground); if (!message.isPrivateMessage()) { if (hasMeCommand) { |