From f1652417c5d1006440b4c889ca052ec1713ac2eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Tue, 29 Jul 2025 21:06:38 +0200 Subject: Rename DirectMessage functions to include dm/direct Changelog: API: Renamed some functions in `DirectMessage` module to make clear they are related only to direct messages. --- main/Main.hs | 2 +- main/Test.hs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'main') diff --git a/main/Main.hs b/main/Main.hs index 68bbc8a..974038f 100644 --- a/main/Main.hs +++ b/main/Main.hs @@ -369,7 +369,7 @@ interactiveLoop st opts = withTerminal commandCompletion $ \term -> do _ <- liftIO $ do tzone <- getCurrentTimeZone - watchReceivedMessages erebosHead $ \smsg -> do + watchReceivedDirectMessages erebosHead $ \smsg -> do let msg = fromStored smsg extPrintLn $ formatDirectMessage tzone msg case optDmBotEcho opts of diff --git a/main/Test.hs b/main/Test.hs index e697a91..0dee8aa 100644 --- a/main/Test.hs +++ b/main/Test.hs @@ -442,7 +442,7 @@ cmdHeadUnwatch = do initTestHead :: Head LocalState -> Command initTestHead h = do - _ <- liftIO . watchReceivedMessages h . dmReceivedWatcher =<< asks tiOutput + _ <- liftIO . watchReceivedDirectMessages h . dmReceivedWatcher =<< asks tiOutput modify $ \s -> s { tsHead = Just h } loadTestHead :: CommandM (Head LocalState) @@ -849,10 +849,10 @@ cmdDmSendIdentity = do dmList :: Foldable f => Identity f -> Command dmList peer = do - threads <- toThreadList . lookupSharedValue . lsShared . headObject <$> getHead + threads <- dmThreadList . lookupSharedValue . lsShared . headObject <$> getHead case find (sameIdentity peer . msgPeer) threads of Just thread -> do - forM_ (reverse $ threadToList thread) $ \DirectMessage {..} -> cmdOut $ "dm-list-item" + forM_ (reverse $ dmThreadToList thread) $ \DirectMessage {..} -> cmdOut $ "dm-list-item" <> " from " <> (maybe "" T.unpack $ idName msgFrom) <> " text " <> (T.unpack msgText) Nothing -> return () -- cgit v1.2.3