From a0da029631a3c91d1725f855b401eb0a319de11d Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Wed, 26 Jun 2019 12:51:50 +0100 Subject: [PATCH] Sync helpers: add a function to create journal entry from sync entry. --- src/etesync-helpers.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/etesync-helpers.ts b/src/etesync-helpers.ts index 0e35f0c..d877b68 100644 --- a/src/etesync-helpers.ts +++ b/src/etesync-helpers.ts @@ -13,9 +13,18 @@ export function createJournalEntry( const syncEntry = new EteSync.SyncEntry(); syncEntry.action = action; - syncEntry.content = content; + return createJournalEntryFromSyncEntry(etesync, userInfo, journal, prevUid, syncEntry); +} + +export function createJournalEntryFromSyncEntry( + etesync: CredentialsData, + userInfo: UserInfoData, + journal: EteSync.Journal, + prevUid: string | null, + syncEntry: EteSync.SyncEntry) { + const derived = etesync.encryptionKey; let cryptoManager: EteSync.CryptoManager;