From b220b5f6ecab9a46178dc1ec93fca92a01a866fe Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Wed, 27 Dec 2023 18:55:50 +0000 Subject: [PATCH] core: fix contact subscriptions (#3611) --- src/Simplex/Chat.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Simplex/Chat.hs b/src/Simplex/Chat.hs index 9e3994173b..eb16a492ee 100644 --- a/src/Simplex/Chat.hs +++ b/src/Simplex/Chat.hs @@ -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