mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2025-06-29 04:39:53 +00:00
core: do not create group history item (#3586)
* core: do not create group history item * fix tests
This commit is contained in:
parent
b8cb954882
commit
2834b192ce
3 changed files with 10 additions and 8 deletions
|
@ -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'
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue