core: don't mark contacts as used on api get chat (#1522)

This commit is contained in:
JRoberts authored and GitHub committed 2022-12-07 19:05:32 +04:00
1 parent fda8836ab8
commit 9893aa665a
2 files changed
+1 -5

No files matched your search

+1 -2
View File
@@ -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"