mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-03-31 01:05:55 +00:00
core: don't mark contacts as used on api get chat (#1522)
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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")]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user