core: don't calculate chat stats to speed up loading individual chats (#1218)

This commit is contained in:
JRoberts
2022-10-18 13:16:28 +04:00
committed by GitHub
parent 2c347cb7b9
commit e57b9f4cea
2 changed files with 50 additions and 43 deletions
+1
View File
@@ -275,6 +275,7 @@ processChatCommand = \case
ExecAgentStoreSQL query -> CRSQLResult <$> withAgent (`execAgentStoreSQL` query)
APIGetChats withPCC -> CRApiChats <$> withUser' (\user -> withStore' $ \db -> getChatPreviews db user withPCC)
APIGetChat (ChatRef cType cId) pagination search -> withUser $ \user -> case cType of
-- TODO optimize queries calculating ChatStats, currently they're disabled
CTDirect -> CRApiChat . AChat SCTDirect <$> withStore (\db -> getDirectChat db user cId pagination search)
CTGroup -> CRApiChat . AChat SCTGroup <$> withStore (\db -> getGroupChat db user cId pagination search)
CTContactRequest -> pure $ chatCmdError "not implemented"