From 3c31d32a259dcb81741c2bdd5f2ba46ab26fe08a Mon Sep 17 00:00:00 2001 From: joe Date: Wed, 30 Apr 2014 20:57:08 -0400 Subject: merge and makeMemoizingDecrypter now use consistent marshalling of InputFile keys. --- KeyRing.hs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/KeyRing.hs b/KeyRing.hs index 6f73fae..bcd8ac8 100644 --- a/KeyRing.hs +++ b/KeyRing.hs @@ -1370,6 +1370,8 @@ writeWalletKeys krd db wk = do let wip = walletImportFormat (CryptoCoins.private_byte_id nw) (packet mp) return (CryptoCoins.network_name nw,wip) handleIO_ (return report) $ do + -- TODO: This AppendMode stratagy is not easy to adapt from FilePath-based + -- to InputFile-based. withFile n AppendMode $ \fh -> do rs <- forM cs' $ \(net,wip) -> do hPutStrLn fh wip @@ -1607,11 +1609,8 @@ makeMemoizingDecrypter :: KeyRingOperation -> InputFileContext -> IO (MappedPacket -> IO (KikiCondition Packet)) makeMemoizingDecrypter operation ctx = do pws <- - -- TODO: head will throw an exception if a File Descriptor operation - -- file is present. We probably should change OriginMap to use InputFile - -- instead of FilePath. Traversable.mapM (cachedContents ctx . fromJust . pwfile . typ) - (Map.mapKeys (head . resolveInputFile ctx) + (Map.mapKeys (resolveForReport $ Just ctx) $ Map.filter (isJust . pwfile . typ) $ kFiles operation) unkeysRef <- newIORef Map.empty return $ doDecrypt unkeysRef pws @@ -2278,7 +2277,7 @@ uidkey (UserIDPacket str) = str merge :: KeyDB -> InputFile -> Message -> KeyDB merge db inputfile (Message ps) = merge_ db filename qs where - filename = concat $ resolveInputFile (InputFileContext "&secret" "&public") inputfile + filename = resolveForReport Nothing inputfile qs = scanPackets filename ps -- cgit v1.2.3