diff options
Diffstat (limited to 'src/eu')
-rw-r--r-- | src/eu/siacs/conversations/entities/Message.java | 18 | ||||
-rw-r--r-- | src/eu/siacs/conversations/ui/adapter/MessageAdapter.java | 6 |
2 files changed, 21 insertions, 3 deletions
diff --git a/src/eu/siacs/conversations/entities/Message.java b/src/eu/siacs/conversations/entities/Message.java index 2dc1bfb5f..84aac4f5a 100644 --- a/src/eu/siacs/conversations/entities/Message.java +++ b/src/eu/siacs/conversations/entities/Message.java @@ -336,6 +336,24 @@ public class Message extends AbstractEntity { } return body.trim(); } + + public int getMergedStatus() { + Message next = this.next(); + if (this.mergable(next)) { + return next.getMergedStatus(); + } else { + return getStatus(); + } + } + + public long getMergedTimeSent() { + Message next = this.next(); + if (this.mergable(next)) { + return next.getMergedTimeSent(); + } else { + return getTimeSent(); + } + } public boolean wasMergedIntoPrevious() { Message prev = this.prev(); diff --git a/src/eu/siacs/conversations/ui/adapter/MessageAdapter.java b/src/eu/siacs/conversations/ui/adapter/MessageAdapter.java index fcb574904..637711aba 100644 --- a/src/eu/siacs/conversations/ui/adapter/MessageAdapter.java +++ b/src/eu/siacs/conversations/ui/adapter/MessageAdapter.java @@ -96,7 +96,7 @@ public class MessageAdapter extends ArrayAdapter<Message> { String info = null; boolean error = false; boolean multiReceived = message.getConversation().getMode() == Conversation.MODE_MULTI - && message.getStatus() <= Message.STATUS_RECEIVED; + && message.getMergedStatus() <= Message.STATUS_RECEIVED; if (message.getType() == Message.TYPE_IMAGE) { String[] fileParams = message.getBody().split(","); try { @@ -106,7 +106,7 @@ public class MessageAdapter extends ArrayAdapter<Message> { filesize = "0 KB"; } } - switch (message.getStatus()) { + switch (message.getMergedStatus()) { case Message.STATUS_WAITING: info = getContext().getString(R.string.waiting); break; @@ -154,7 +154,7 @@ public class MessageAdapter extends ArrayAdapter<Message> { } String formatedTime = UIHelper.readableTimeDifference(getContext(), - message.getTimeSent()); + message.getMergedTimeSent()); if (message.getStatus() <= Message.STATUS_RECEIVED) { if ((filesize != null) && (info != null)) { viewHolder.time.setText(filesize + " \u00B7 " + info); |