core: fix contact subscriptions (#3611)

This commit is contained in:
Evgeny Poberezkin
2023-12-27 18:55:50 +00:00
committed by GitHub
parent 0b8346701c
commit b220b5f6ec
+2 -2
View File
@@ -2854,8 +2854,8 @@ subscribeUserConnections vr onlyNeeded agentBatchSubscribe user@User {userId} =
getContactConns :: m ([ConnId], Map ConnId Contact)
getContactConns = do
cts <- withStore_ ("subscribeUserConnections " <> show userId <> ", getUserContacts") getUserContacts
let connIds = mapMaybe contactConnId (filter contactActive cts)
pure (connIds, M.fromList $ zip connIds cts)
let cts' = mapMaybe (\ct -> (,ct) <$> contactConnId ct) $ filter contactActive cts
pure (map fst cts', M.fromList cts')
getUserContactLinkConns :: m ([ConnId], Map ConnId UserContact)
getUserContactLinkConns = do
(cs, ucs) <- unzip <$> withStore_ ("subscribeUserConnections " <> show userId <> ", getUserContactLinks") getUserContactLinks