diff options
Diffstat (limited to 'main')
| -rw-r--r-- | main/Main.hs | 8 | ||||
| -rw-r--r-- | main/Test.hs | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/main/Main.hs b/main/Main.hs index 604d58f..654c04b 100644 --- a/main/Main.hs +++ b/main/Main.hs @@ -467,7 +467,7 @@ interactiveLoop st opts = withTerminal commandCompletion $ \term -> do chatroomSetVar <- liftIO $ newEmptyMVar let autoSubscribe = optChatroomAutoSubscribe opts - chatroomList = fromSetBy (comparing roomStateData) . lookupSharedValue . lsShared . headObject $ erebosHead + chatroomList = fromSetBy (comparing roomStateData) . lookupSharedValueH $ erebosHead watched <- if isJust autoSubscribe || any roomStateSubscribe chatroomList then do fmap Just $ liftIO $ watchChatroomsForCli tui extPrintLn erebosHead @@ -1042,7 +1042,7 @@ cmdContacts :: Command cmdContacts = do args <- words <$> asks ciLine ehead <- gets csHead - let contacts = fromSetBy (comparing contactName) $ lookupSharedValue $ lsShared $ headObject ehead + let contacts = fromSetBy (comparing contactName) $ lookupSharedValueH ehead verbose = "-v" `elem` args set <- asks ciSetContextOptions set WatchContacts $ map SelectedContact contacts @@ -1075,7 +1075,7 @@ cmdInviteContact = do _ -> liftIO $ do setPrompt term "Name: " getInputLine term $ KeepPrompt . maybe T.empty T.pack - (lookupSharedValue . lsShared . fromStored <$> getLocalHead) >>= \case + lookupSharedValueM >>= \case Just (self :: ComposedIdentity) -> do invite <- createSingleContactInvite name dgst : _ <- return $ refDigest . storedRef <$> idDataF self @@ -1163,7 +1163,7 @@ cmdDetails = do NoContext -> cmdPutStrLn "nothing selected" where printContactOrIdentityDetails cid = do - contacts <- fromSetBy (comparing contactName) . lookupSharedValue . lsShared . fromStored <$> getLocalHead + contacts <- fromSetBy (comparing contactName) <$> lookupSharedValueM case find (maybe False (sameIdentity cid) . contactIdentity) contacts of Just contact -> printContactDetails contact Nothing -> printIdentityDetails cid 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" |