From 9b82cc33030469012a12d48d266f17e43421978f Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin Date: Fri, 6 Dec 2024 10:18:48 +0000 Subject: [PATCH] core: fix feature items when updating preferences in business chats --- src/Simplex/Chat/Store/Groups.hs | 2 +- tests/ChatTests/Profiles.hs | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Simplex/Chat/Store/Groups.hs b/src/Simplex/Chat/Store/Groups.hs index 49158a60c9..36ce7f3575 100644 --- a/src/Simplex/Chat/Store/Groups.hs +++ b/src/Simplex/Chat/Store/Groups.hs @@ -1472,7 +1472,7 @@ updateGroupPreferences db User {userId} g@GroupInfo {groupId, groupProfile = p} ) |] (ps, currentTs, userId, groupId) - pure (g :: GroupInfo) {groupProfile = p {groupPreferences = Just ps}} + pure (g :: GroupInfo) {groupProfile = p {groupPreferences = Just ps}, fullGroupPreferences = mergeGroupPreferences $ Just ps} updateGroupProfileFromMember :: DB.Connection -> User -> GroupInfo -> Profile -> ExceptT StoreError IO GroupInfo updateGroupProfileFromMember db user g@GroupInfo {groupId} Profile {displayName = n, fullName = fn, image = img} = do diff --git a/tests/ChatTests/Profiles.hs b/tests/ChatTests/Profiles.hs index 2bf157419c..71edbb93b0 100644 --- a/tests/ChatTests/Profiles.hs +++ b/tests/ChatTests/Profiles.hs @@ -857,6 +857,10 @@ testBusinessUpdateProfiles = testChat4 businessProfile aliceProfile bobProfile c cath <## "updated group preferences:" cath <## "Voice messages: on" ] + biz #$> ("/_get chat #1 count=1", chat, [(1, "Voice messages: on")]) + alice #$> ("/_get chat #1 count=1", chat, [(0, "Voice messages: on")]) + bob #$> ("/_get chat #1 count=1", chat, [(0, "Voice messages: on")]) + cath #$> ("/_get chat #1 count=1", chat, [(0, "Voice messages: on")]) testPlanAddressOkKnown :: HasCallStack => FilePath -> IO () testPlanAddressOkKnown =