From 44094e8f19ad410ac7fc78ddbc9e18f42bc3cf62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Tue, 29 Jul 2025 10:04:33 +0200 Subject: Rename peerIdentity to getPeerIdentity Changelog: API: Renamed `Network.peerIdentity` to `getPeerIdentity`. --- main/Main.hs | 8 ++++---- main/Test.hs | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'main') diff --git a/main/Main.hs b/main/Main.hs index 04ae057..68bbc8a 100644 --- a/main/Main.hs +++ b/main/Main.hs @@ -325,7 +325,7 @@ interactiveLoop st opts = withTerminal commandCompletion $ \term -> do Left cstate -> do pname <- case csContext cstate of NoContext -> return "" - SelectedPeer peer -> peerIdentity peer >>= return . \case + SelectedPeer peer -> getPeerIdentity peer >>= return . \case PeerIdentityFull pid -> maybe "" T.unpack $ idName $ finalOwner pid PeerIdentityRef wref _ -> "<" ++ BC.unpack (showRefDigest $ wrDigest wref) ++ ">" PeerIdentityUnknown _ -> "" @@ -400,7 +400,7 @@ interactiveLoop st opts = withTerminal commandCompletion $ \term -> do void $ liftIO $ forkIO $ void $ forever $ do peer <- getNextPeerChange server - peerIdentity peer >>= \case + getPeerIdentity peer >>= \case pid@(PeerIdentityFull _) -> do dropped <- isPeerDropped peer shown <- showPeer pid <$> getPeerAddress peer @@ -527,7 +527,7 @@ getSelectedConversation = gets csContext >>= getConversationFromContext getConversationFromContext :: CommandContext -> CommandM Conversation getConversationFromContext = \case - SelectedPeer peer -> peerIdentity peer >>= \case + SelectedPeer peer -> getPeerIdentity peer >>= \case PeerIdentityFull pid -> directMessageConversation $ finalOwner pid _ -> throwOtherError "incomplete peer identity" SelectedContact contact -> case contactIdentity contact of @@ -885,7 +885,7 @@ cmdDetails = do [ "Network peer:" , " " <> show paddr ] - peerIdentity peer >>= \case + getPeerIdentity peer >>= \case PeerIdentityUnknown _ -> do cmdPutStrLn $ "unknown identity" PeerIdentityRef wref _ -> do diff --git a/main/Test.hs b/main/Test.hs index 1167bee..e697a91 100644 --- a/main/Test.hs +++ b/main/Test.hs @@ -557,7 +557,7 @@ cmdStartServer = do peer <- getNextPeerChange rsServer let printPeer TestPeer {..} = do - params <- peerIdentity tpPeer >>= \case + params <- getPeerIdentity tpPeer >>= \case PeerIdentityFull pid -> do return $ ("id":) $ map (maybe "" T.unpack . idName) (unfoldOwners pid) _ -> do @@ -613,7 +613,7 @@ cmdPeerList = do tpeers <- liftIO $ readMVar rsPeers forM_ peers $ \peer -> do Just tp <- return $ find ((peer ==) . tpPeer) . snd $ tpeers - mbpid <- peerIdentity peer + mbpid <- getPeerIdentity peer paddr <- getPeerAddress peer cmdOut $ unwords $ concat [ [ "peer-list-item", show (tpIndex tp) ] @@ -830,7 +830,7 @@ cmdContactSetName = do cmdDmSendPeer :: Command cmdDmSendPeer = do [spidx, msg] <- asks tiParams - PeerIdentityFull to <- peerIdentity =<< getPeer spidx + PeerIdentityFull to <- getPeerIdentity =<< getPeer spidx void $ sendDirectMessage to msg cmdDmSendContact :: Command @@ -861,7 +861,7 @@ dmList peer = do cmdDmListPeer :: Command cmdDmListPeer = do [spidx] <- asks tiParams - PeerIdentityFull to <- peerIdentity =<< getPeer spidx + PeerIdentityFull to <- getPeerIdentity =<< getPeer spidx dmList to cmdDmListContact :: Command -- cgit v1.2.3