mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-18 21:59:54 +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);
|
this::showImageOnboarding);
|
||||||
}
|
}
|
||||||
List<ConversationItem> items = createItems(headers);
|
List<ConversationItem> items = createItems(headers);
|
||||||
adapter.addAll(items);
|
adapter.replaceAll(items);
|
||||||
list.showData();
|
list.showData();
|
||||||
if (layoutManagerState == null) {
|
if (layoutManagerState == null) {
|
||||||
scrollToBottom();
|
scrollToBottom();
|
||||||
|
|||||||
@@ -120,11 +120,11 @@ class ConversationAdapter
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addAll(Collection<ConversationItem> itemsToAdd) {
|
public void replaceAll(Collection<ConversationItem> itemsToReplace) {
|
||||||
items.beginBatchedUpdates();
|
items.beginBatchedUpdates();
|
||||||
// there can be items already in the adapter
|
// there can be items already in the adapter
|
||||||
// SortedList takes care of duplicates and detecting changed items
|
// SortedList takes care of duplicates and detecting changed items
|
||||||
items.addAll(itemsToAdd);
|
items.replaceAll(itemsToReplace);
|
||||||
updateTimersInBatch();
|
updateTimersInBatch();
|
||||||
items.endBatchedUpdates();
|
items.endBatchedUpdates();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user