Support unregisteredAtTimestamp in storage service
This commit is contained in:
parent
6936cc1e2e
commit
62647a357f
6 changed files with 154 additions and 34 deletions
|
@ -175,6 +175,9 @@ export async function toContactRecord(
|
|||
if (conversation.get('hideStory') !== undefined) {
|
||||
contactRecord.hideStory = Boolean(conversation.get('hideStory'));
|
||||
}
|
||||
contactRecord.unregisteredAtTimestamp = getSafeLongFromTimestamp(
|
||||
conversation.get('firstUnregisteredAt')
|
||||
);
|
||||
|
||||
applyUnknownFields(contactRecord, conversation);
|
||||
|
||||
|
@ -986,6 +989,19 @@ export async function mergeContactRecord(
|
|||
}
|
||||
);
|
||||
|
||||
if (
|
||||
!contactRecord.unregisteredAtTimestamp ||
|
||||
contactRecord.unregisteredAtTimestamp.equals(0)
|
||||
) {
|
||||
conversation.setRegistered({ fromStorageService: true, shouldSave: false });
|
||||
} else {
|
||||
conversation.setUnregistered({
|
||||
timestamp: getTimestampFromLong(contactRecord.unregisteredAtTimestamp),
|
||||
fromStorageService: true,
|
||||
shouldSave: false,
|
||||
});
|
||||
}
|
||||
|
||||
const { hasConflict, details: extraDetails } = doesRecordHavePendingChanges(
|
||||
await toContactRecord(conversation),
|
||||
contactRecord,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue