Merge branch 'master-ghc8107' into master-android

This commit is contained in:
Evgeny Poberezkin 2023-12-23 19:57:27 +00:00
commit cb49f6f01d
3 changed files with 10 additions and 8 deletions

View File

@ -4784,7 +4784,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
@ -5987,7 +5987,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'

View File

@ -182,17 +182,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 = \case
SGFTimedMessages -> timedMessages

View File

@ -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