mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 18:59:06 +01:00
test setting read flag for shard messages
This commit is contained in:
@@ -303,7 +303,8 @@ class SocialBackupManagerImpl extends ConversationClientImpl
|
||||
SHARD.getValue()) {
|
||||
boolean isLocal = meta.getBoolean(MSG_KEY_LOCAL);
|
||||
|
||||
MessageStatus status = db.getMessageStatus(txn, contactId, messageEntry.getKey());
|
||||
MessageStatus status = db.getMessageStatus(txn, contactId,
|
||||
messageEntry.getKey());
|
||||
long timestamp;
|
||||
if (isLocal) {
|
||||
timestamp = meta.getLong(MSG_KEY_TIMESTAMP);
|
||||
@@ -316,7 +317,8 @@ class SocialBackupManagerImpl extends ConversationClientImpl
|
||||
new ArrayList<>();
|
||||
ShardMessageHeader shardHeader = new ShardMessageHeader(
|
||||
messageEntry.getKey(), contactGroupId, timestamp,
|
||||
isLocal, false, status.isSent(), status.isSeen(), attachmentHeaders);
|
||||
isLocal, false, status.isSent(), status.isSeen(),
|
||||
attachmentHeaders);
|
||||
headers.add(shardHeader);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -138,6 +138,11 @@ public class SocialBackupIntegrationTest
|
||||
assertGroupCount(messageTracker0, g2From0.getId(), 1, 0);
|
||||
assertGroupCount(messageTracker1, g0From1.getId(), 1, 1);
|
||||
assertGroupCount(messageTracker2, g0From2.getId(), 1, 1);
|
||||
|
||||
// mark a message as read
|
||||
socialBackupManager1.setReadFlag(g0From1.getId(),
|
||||
messages0At1.iterator().next().getId(), true);
|
||||
assertGroupCount(messageTracker1, g0From1.getId(), 1, 0);
|
||||
}
|
||||
|
||||
private Collection<ConversationMessageHeader> getMessages1At0()
|
||||
|
||||
Reference in New Issue
Block a user