diff --git a/src/Simplex/Chat.hs b/src/Simplex/Chat.hs index f5803eb626..a8b1284b9a 100644 --- a/src/Simplex/Chat.hs +++ b/src/Simplex/Chat.hs @@ -4783,7 +4783,7 @@ processAgentMessageConn user@User {userId} corrId agentConnId agentMessage = do createGroupFeatureItems :: GroupInfo -> GroupMember -> m () createGroupFeatureItems g@GroupInfo {fullGroupPreferences} m = - forM_ allGroupFeatures $ \(AGF f) -> do + forM_ allGroupFeatureItems $ \(AGF f) -> do let p = getGroupPreference f fullGroupPreferences (_, param) = groupFeatureState p createInternalChatItem user (CDGroupRcv g m) (CIRcvGroupFeature (toGroupFeature f) (toGroupPreference p) param) Nothing @@ -5986,7 +5986,7 @@ createFeatureItems user Contact {mergedPreferences = cups} ct'@Contact {mergedPr createGroupFeatureChangedItems :: (MsgDirectionI d, ChatMonad m) => User -> ChatDirection 'CTGroup d -> (GroupFeature -> GroupPreference -> Maybe Int -> CIContent d) -> GroupInfo -> GroupInfo -> m () createGroupFeatureChangedItems user cd ciContent GroupInfo {fullGroupPreferences = gps} GroupInfo {fullGroupPreferences = gps'} = - forM_ allGroupFeatures $ \(AGF f) -> do + forM_ allGroupFeatureItems $ \(AGF f) -> do let state = groupFeatureState $ getGroupPreference f gps pref' = getGroupPreference f gps' state'@(_, int') = groupFeatureState pref' diff --git a/src/Simplex/Chat/Types/Preferences.hs b/src/Simplex/Chat/Types/Preferences.hs index 5c79680c50..18a10a83f4 100644 --- a/src/Simplex/Chat/Types/Preferences.hs +++ b/src/Simplex/Chat/Types/Preferences.hs @@ -184,17 +184,19 @@ groupFeatureAllowed' :: GroupFeatureI f => SGroupFeature f -> FullGroupPreferenc groupFeatureAllowed' feature prefs = getField @"enable" (getGroupPreference feature prefs) == FEOn -allGroupFeatures :: [AGroupFeature] -allGroupFeatures = +allGroupFeatureItems :: [AGroupFeature] +allGroupFeatureItems = [ AGF SGFTimedMessages, AGF SGFDirectMessages, AGF SGFFullDelete, AGF SGFReactions, AGF SGFVoice, - AGF SGFFiles, - AGF SGFHistory + AGF SGFFiles ] +allGroupFeatures :: [AGroupFeature] +allGroupFeatures = allGroupFeatureItems <> [AGF SGFHistory] + groupPrefSel :: SGroupFeature f -> GroupPreferences -> Maybe (GroupFeaturePreference f) groupPrefSel f ps = case f of SGFTimedMessages -> ps.timedMessages diff --git a/tests/ChatTests/Utils.hs b/tests/ChatTests/Utils.hs index 07537f76f3..1fc00d913b 100644 --- a/tests/ChatTests/Utils.hs +++ b/tests/ChatTests/Utils.hs @@ -221,8 +221,8 @@ groupFeatures'' = ((0, "Full deletion: off"), Nothing, Nothing), ((0, "Message reactions: on"), Nothing, Nothing), ((0, "Voice messages: on"), Nothing, Nothing), - ((0, "Files and media: on"), Nothing, Nothing), - ((0, "Recent history: on"), Nothing, Nothing) + ((0, "Files and media: on"), Nothing, Nothing) + -- ((0, "Recent history: on"), Nothing, Nothing) ] itemId :: Int -> String