summaryrefslogtreecommitdiff
path: root/main/Test.hs
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2026-08-02 15:42:34 +0200
committerRoman Smrž <roman.smrz@seznam.cz>2026-08-05 21:55:55 +0200
commitcb3e2abade4a0aa1ad13f4aa1632b1e05af4d29a (patch)
tree5ee32f2e21b5fa504bdb1d30a717dffa4f17ac34 /main/Test.hs
parent0efd90e5f01996ceb01f5a2889f9e2986322c371 (diff)
Use cached values for shared state lookups
Diffstat (limited to 'main/Test.hs')
-rw-r--r--main/Test.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/main/Test.hs b/main/Test.hs
index 9038083..f9657c2 100644
--- a/main/Test.hs
+++ b/main/Test.hs
@@ -849,7 +849,7 @@ cmdWatchSharedIdentity = do
Nothing <- gets tsWatchedSharedIdentity
out <- asks tiOutput
- w <- liftIO $ watchHeadWith h (lookupSharedValue . lsShared . headObject) $ \case
+ w <- liftIO $ watchHeadWith h lookupSharedValueH $ \case
Just (idt :: ComposedIdentity) -> do
outLine out $ unwords $ "shared-identity" : map (maybe "<unnamed>" T.unpack . idName) (unfoldOwners idt)
Nothing -> do
@@ -919,7 +919,7 @@ cmdContactReject = do
cmdContactList :: Command
cmdContactList = do
h <- getHead
- let contacts = fromSetBy (comparing contactName) . lookupSharedValue . lsShared . headObject $ h
+ let contacts = fromSetBy (comparing contactName) . lookupSharedValueH $ h
forM_ contacts $ \c -> do
r:_ <- return $ filterAncestors $ concatMap storedRoots $ toComponents c
cmdOut $ concat
@@ -934,7 +934,7 @@ cmdContactList = do
getContact :: Text -> CommandM Contact
getContact cid = do
h <- getHead
- let contacts = fromSetBy (comparing contactName) . lookupSharedValue . lsShared . headObject $ h
+ let contacts = fromSetBy (comparing contactName) . lookupSharedValueH $ h
[contact] <- flip filterM contacts $ \c -> do
r:_ <- return $ filterAncestors $ concatMap storedRoots $ toComponents c
return $ T.pack (show $ refDigest $ storedRef r) == cid
@@ -975,7 +975,7 @@ cmdDmSendIdentity = do
dmList :: Foldable f => Identity f -> Command
dmList peer = do
- threads <- dmThreadList . lookupSharedValue . lsShared . headObject <$> getHead
+ threads <- dmThreadList . lookupSharedValueH <$> getHead
case find (sameIdentity peer . msgPeer) threads of
Just thread -> do
forM_ (reverse $ dmThreadToListUnread thread) $ \( DirectMessage {..}, new ) -> cmdOut $ "dm-list-item"