mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 19:29:06 +01:00
Replace all messages when re-loading
to ensure that messages deleted in the meantime get removed
This commit is contained in:
@@ -573,7 +573,7 @@ public class ConversationActivity extends BriarActivity
|
||||
this::showImageOnboarding);
|
||||
}
|
||||
List<ConversationItem> items = createItems(headers);
|
||||
adapter.addAll(items);
|
||||
adapter.replaceAll(items);
|
||||
list.showData();
|
||||
if (layoutManagerState == null) {
|
||||
scrollToBottom();
|
||||
|
||||
@@ -120,11 +120,11 @@ class ConversationAdapter
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addAll(Collection<ConversationItem> itemsToAdd) {
|
||||
public void replaceAll(Collection<ConversationItem> itemsToReplace) {
|
||||
items.beginBatchedUpdates();
|
||||
// there can be items already in the adapter
|
||||
// SortedList takes care of duplicates and detecting changed items
|
||||
items.addAll(itemsToAdd);
|
||||
items.replaceAll(itemsToReplace);
|
||||
updateTimersInBatch();
|
||||
items.endBatchedUpdates();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user