diff --git a/src/Simplex/Chat.hs b/src/Simplex/Chat.hs index d8b86fb495..cc3d576041 100644 --- a/src/Simplex/Chat.hs +++ b/src/Simplex/Chat.hs @@ -280,8 +280,7 @@ processChatCommand = \case APIGetChat (ChatRef cType cId) pagination search -> withUser $ \user -> case cType of -- TODO optimize queries calculating ChatStats, currently they're disabled CTDirect -> do - directChat@Chat {chatInfo} <- withStore (\db -> getDirectChat db user cId pagination search) - case chatInfo of DirectChat ct@Contact {contactUsed} -> unless contactUsed $ withStore' $ \db -> updateContactUsed db user ct + directChat <- withStore (\db -> getDirectChat db user cId pagination search) pure . CRApiChat $ AChat SCTDirect directChat CTGroup -> CRApiChat . AChat SCTGroup <$> withStore (\db -> getGroupChat db user cId pagination search) CTContactRequest -> pure $ chatCmdError "not implemented" diff --git a/tests/ChatTests.hs b/tests/ChatTests.hs index 5706e88167..4eb9159f55 100644 --- a/tests/ChatTests.hs +++ b/tests/ChatTests.hs @@ -4123,9 +4123,6 @@ testGroupLink = -- contacts connected via group link are not in chat previews alice @@@ [("#team", "connected")] bob @@@ [("#team", "connected")] - -- calling /_get chat api marks it as used and adds it to chat previews - alice #$> ("/_get chat @2 count=100", chat, []) - alice @@@ [("@bob", ""), ("#team", "connected")] alice <##> bob alice @@@ [("@bob", "hey"), ("#team", "connected")]