prepend instead off append mam messages to conversations when going in reverse
This commit is contained in:
parent
28733e052f
commit
91ec4839ac
|
@ -814,6 +814,13 @@ public class Conversation extends AbstractEntity implements Blockable {
|
|||
}
|
||||
}
|
||||
|
||||
public void prepend(Message message) {
|
||||
message.setConversation(this);
|
||||
synchronized (this.messages) {
|
||||
this.messages.add(0,message);
|
||||
}
|
||||
}
|
||||
|
||||
public void addAll(int index, List<Message> messages) {
|
||||
synchronized (this.messages) {
|
||||
this.messages.addAll(index, messages);
|
||||
|
|
|
@ -398,7 +398,11 @@ public class MessageParser extends AbstractParser implements
|
|||
return;
|
||||
}
|
||||
|
||||
if (query != null && query.getPagingOrder() == MessageArchiveService.PagingOrder.REVERSE) {
|
||||
conversation.prepend(message);
|
||||
} else {
|
||||
conversation.add(message);
|
||||
}
|
||||
|
||||
if (query == null || query.getWith() == null) { //either no mam or catchup
|
||||
if (status == Message.STATUS_SEND || status == Message.STATUS_SEND_RECEIVED) {
|
||||
|
|
Loading…
Reference in New Issue