From 05b55d3fb5fb570d576d844d11d0c39f73c7d661 Mon Sep 17 00:00:00 2001 From: spaced4ndy <8711996+spaced4ndy@users.noreply.github.com> Date: Fri, 29 Dec 2023 21:46:28 +0400 Subject: [PATCH] ui: group history preference, enable in new groups by default; core: create group history feature items (#3596) * Revert "core: do not create group history item (#3586)" This reverts commit 2834b192ce8e10ef17bb240623df4211bbea378c. * ios: group history preference * fix tests * android * texts * enable in new groups ios * enable in new groups android * android texts * ios texts * remove ellipsis --------- Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> --- .../Views/Chat/ContactPreferencesView.swift | 1 - .../Chat/Group/GroupPreferencesView.swift | 2 +- .../Shared/Views/NewChat/AddGroupView.swift | 1 + .../Views/UserSettings/PreferencesView.swift | 1 - apps/ios/SimpleXChat/ChatTypes.swift | 57 +++++++++++++------ .../chat/simplex/common/model/SimpleXAPI.kt | 31 +++++++--- .../views/chat/group/GroupPreferences.kt | 5 ++ .../common/views/newchat/AddGroupView.kt | 3 +- .../commonMain/resources/MR/base/strings.xml | 19 ++++--- .../resources/MR/images/ic_schedule.svg | 1 + .../MR/images/ic_schedule_filled.svg | 1 + src/Simplex/Chat.hs | 4 +- src/Simplex/Chat/Types/Preferences.hs | 10 ++-- tests/ChatTests/Groups.hs | 6 +- tests/ChatTests/Utils.hs | 4 +- 15 files changed, 98 insertions(+), 48 deletions(-) create mode 100644 apps/multiplatform/common/src/commonMain/resources/MR/images/ic_schedule.svg create mode 100644 apps/multiplatform/common/src/commonMain/resources/MR/images/ic_schedule_filled.svg diff --git a/apps/ios/Shared/Views/Chat/ContactPreferencesView.swift b/apps/ios/Shared/Views/Chat/ContactPreferencesView.swift index ff1892d99..57007fff3 100644 --- a/apps/ios/Shared/Views/Chat/ContactPreferencesView.swift +++ b/apps/ios/Shared/Views/Chat/ContactPreferencesView.swift @@ -116,7 +116,6 @@ struct ContactPreferencesView: View { private func featureFooter(_ feature: ChatFeature, _ enabled: FeatureEnabled) -> some View { Text(feature.enabledDescription(enabled)) - .frame(height: 36, alignment: .topLeading) } private func savePreferences() { diff --git a/apps/ios/Shared/Views/Chat/Group/GroupPreferencesView.swift b/apps/ios/Shared/Views/Chat/Group/GroupPreferencesView.swift index 860a6febb..d88bdfa4a 100644 --- a/apps/ios/Shared/Views/Chat/Group/GroupPreferencesView.swift +++ b/apps/ios/Shared/Views/Chat/Group/GroupPreferencesView.swift @@ -28,6 +28,7 @@ struct GroupPreferencesView: View { featureSection(.reactions, $preferences.reactions.enable) featureSection(.voice, $preferences.voice.enable) featureSection(.files, $preferences.files.enable) + featureSection(.history, $preferences.history.enable) if groupInfo.canEdit { Section { @@ -96,7 +97,6 @@ struct GroupPreferencesView: View { } } footer: { Text(feature.enableDescription(enableFeature.wrappedValue, groupInfo.canEdit)) - .frame(height: 36, alignment: .topLeading) } } diff --git a/apps/ios/Shared/Views/NewChat/AddGroupView.swift b/apps/ios/Shared/Views/NewChat/AddGroupView.swift index 6c7919669..3f3623033 100644 --- a/apps/ios/Shared/Views/NewChat/AddGroupView.swift +++ b/apps/ios/Shared/Views/NewChat/AddGroupView.swift @@ -187,6 +187,7 @@ struct AddGroupView: View { hideKeyboard() do { profile.displayName = profile.displayName.trimmingCharacters(in: .whitespaces) + profile.groupPreferences = GroupPreferences(history: GroupPreference(enable: .on)) let gInfo = try apiNewGroup(incognito: incognitoDefault, groupProfile: profile) Task { let groupMembers = await apiListMembers(gInfo.groupId) diff --git a/apps/ios/Shared/Views/UserSettings/PreferencesView.swift b/apps/ios/Shared/Views/UserSettings/PreferencesView.swift index 960afb6d3..2e560f857 100644 --- a/apps/ios/Shared/Views/UserSettings/PreferencesView.swift +++ b/apps/ios/Shared/Views/UserSettings/PreferencesView.swift @@ -63,7 +63,6 @@ struct PreferencesView: View { private func featureFooter(_ feature: ChatFeature, _ allowFeature: Binding) -> some View { Text(feature.allowDescription(allowFeature.wrappedValue)) - .frame(height: 36, alignment: .topLeading) } private func savePreferences() { diff --git a/apps/ios/SimpleXChat/ChatTypes.swift b/apps/ios/SimpleXChat/ChatTypes.swift index 02c693cd2..74e5e4a3c 100644 --- a/apps/ios/SimpleXChat/ChatTypes.swift +++ b/apps/ios/SimpleXChat/ChatTypes.swift @@ -616,8 +616,8 @@ public enum ChatFeature: String, Decodable, Feature { } case .fullDelete: switch allowed { - case .always: return "Allow your contacts to irreversibly delete sent messages." - case .yes: return "Allow irreversible message deletion only if your contact allows it to you." + case .always: return "Allow your contacts to irreversibly delete sent messages. (24 hours)" + case .yes: return "Allow irreversible message deletion only if your contact allows it to you. (24 hours)" case .no: return "Contacts can mark messages for deletion; you will be able to view them." } case .reactions: @@ -653,11 +653,11 @@ public enum ChatFeature: String, Decodable, Feature { : "Disappearing messages are prohibited in this chat." case .fullDelete: return enabled.forUser && enabled.forContact - ? "Both you and your contact can irreversibly delete sent messages." + ? "Both you and your contact can irreversibly delete sent messages. (24 hours)" : enabled.forUser - ? "Only you can irreversibly delete messages (your contact can mark them for deletion)." + ? "Only you can irreversibly delete messages (your contact can mark them for deletion). (24 hours)" : enabled.forContact - ? "Only your contact can irreversibly delete messages (you can mark them for deletion)." + ? "Only your contact can irreversibly delete messages (you can mark them for deletion). (24 hours)" : "Irreversible message deletion is prohibited in this chat." case .reactions: return enabled.forUser && enabled.forContact @@ -694,6 +694,7 @@ public enum GroupFeature: String, Decodable, Feature { case reactions case voice case files + case history public var id: Self { self } @@ -712,6 +713,7 @@ public enum GroupFeature: String, Decodable, Feature { case .reactions: return NSLocalizedString("Message reactions", comment: "chat feature") case .voice: return NSLocalizedString("Voice messages", comment: "chat feature") case .files: return NSLocalizedString("Files and media", comment: "chat feature") + case .history: return NSLocalizedString("Visible history", comment: "chat feature") } } @@ -723,6 +725,7 @@ public enum GroupFeature: String, Decodable, Feature { case .reactions: return "face.smiling" case .voice: return "mic" case .files: return "doc" + case .history: return "clock" } } @@ -734,6 +737,7 @@ public enum GroupFeature: String, Decodable, Feature { case .reactions: return "face.smiling.fill" case .voice: return "mic.fill" case .files: return "doc.fill" + case .history: return "clock.fill" } } @@ -759,7 +763,7 @@ public enum GroupFeature: String, Decodable, Feature { } case .fullDelete: switch enabled { - case .on: return "Allow to irreversibly delete sent messages." + case .on: return "Allow to irreversibly delete sent messages. (24 hours)" case .off: return "Prohibit irreversible message deletion." } case .reactions: @@ -777,6 +781,11 @@ public enum GroupFeature: String, Decodable, Feature { case .on: return "Allow to send files and media." case .off: return "Prohibit sending files and media." } + case .history: + switch enabled { + case .on: return "Send up to 100 last messages to new members." + case .off: return "Do not send history to new members." + } } } else { switch self { @@ -792,7 +801,7 @@ public enum GroupFeature: String, Decodable, Feature { } case .fullDelete: switch enabled { - case .on: return "Group members can irreversibly delete sent messages." + case .on: return "Group members can irreversibly delete sent messages. (24 hours)" case .off: return "Irreversible message deletion is prohibited in this group." } case .reactions: @@ -810,6 +819,11 @@ public enum GroupFeature: String, Decodable, Feature { case .on: return "Group members can send files and media." case .off: return "Files and media are prohibited in this group." } + case .history: + switch enabled { + case .on: return "Up to 100 last messages are sent to new members." + case .off: return "History is not sent to new members." + } } } } @@ -949,6 +963,7 @@ public struct FullGroupPreferences: Decodable, Equatable { public var reactions: GroupPreference public var voice: GroupPreference public var files: GroupPreference + public var history: GroupPreference public init( timedMessages: TimedMessagesGroupPreference, @@ -956,7 +971,8 @@ public struct FullGroupPreferences: Decodable, Equatable { fullDelete: GroupPreference, reactions: GroupPreference, voice: GroupPreference, - files: GroupPreference + files: GroupPreference, + history: GroupPreference ) { self.timedMessages = timedMessages self.directMessages = directMessages @@ -964,6 +980,7 @@ public struct FullGroupPreferences: Decodable, Equatable { self.reactions = reactions self.voice = voice self.files = files + self.history = history } public static let sampleData = FullGroupPreferences( @@ -972,7 +989,8 @@ public struct FullGroupPreferences: Decodable, Equatable { fullDelete: GroupPreference(enable: .off), reactions: GroupPreference(enable: .on), voice: GroupPreference(enable: .on), - files: GroupPreference(enable: .on) + files: GroupPreference(enable: .on), + history: GroupPreference(enable: .on) ) } @@ -983,14 +1001,16 @@ public struct GroupPreferences: Codable { public var reactions: GroupPreference? public var voice: GroupPreference? public var files: GroupPreference? + public var history: GroupPreference? public init( - timedMessages: TimedMessagesGroupPreference?, - directMessages: GroupPreference?, - fullDelete: GroupPreference?, - reactions: GroupPreference?, - voice: GroupPreference?, - files: GroupPreference? + timedMessages: TimedMessagesGroupPreference? = nil, + directMessages: GroupPreference? = nil, + fullDelete: GroupPreference? = nil, + reactions: GroupPreference? = nil, + voice: GroupPreference? = nil, + files: GroupPreference? = nil, + history: GroupPreference? = nil ) { self.timedMessages = timedMessages self.directMessages = directMessages @@ -998,6 +1018,7 @@ public struct GroupPreferences: Codable { self.reactions = reactions self.voice = voice self.files = files + self.history = history } public static let sampleData = GroupPreferences( @@ -1006,7 +1027,8 @@ public struct GroupPreferences: Codable { fullDelete: GroupPreference(enable: .off), reactions: GroupPreference(enable: .on), voice: GroupPreference(enable: .on), - files: GroupPreference(enable: .on) + files: GroupPreference(enable: .on), + history: GroupPreference(enable: .on) ) } @@ -1017,7 +1039,8 @@ public func toGroupPreferences(_ fullPreferences: FullGroupPreferences) -> Group fullDelete: fullPreferences.fullDelete, reactions: fullPreferences.reactions, voice: fullPreferences.voice, - files: fullPreferences.files + files: fullPreferences.files, + history: fullPreferences.history ) } diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/model/SimpleXAPI.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/model/SimpleXAPI.kt index 619238f6d..e2ab3a4d9 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/model/SimpleXAPI.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/model/SimpleXAPI.kt @@ -3308,7 +3308,8 @@ enum class GroupFeature: Feature { @SerialName("fullDelete") FullDelete, @SerialName("reactions") Reactions, @SerialName("voice") Voice, - @SerialName("files") Files; + @SerialName("files") Files, + @SerialName("history") History; override val hasParam: Boolean get() = when(this) { TimedMessages -> true @@ -3323,6 +3324,7 @@ enum class GroupFeature: Feature { Reactions -> generalGetString(MR.strings.message_reactions) Voice -> generalGetString(MR.strings.voice_messages) Files -> generalGetString(MR.strings.files_and_media) + History -> generalGetString(MR.strings.recent_history) } val icon: Painter @@ -3333,6 +3335,7 @@ enum class GroupFeature: Feature { Reactions -> painterResource(MR.images.ic_add_reaction) Voice -> painterResource(MR.images.ic_keyboard_voice) Files -> painterResource(MR.images.ic_draft) + History -> painterResource(MR.images.ic_schedule) } @Composable @@ -3343,6 +3346,7 @@ enum class GroupFeature: Feature { Reactions -> painterResource(MR.images.ic_add_reaction_filled) Voice -> painterResource(MR.images.ic_keyboard_voice_filled) Files -> painterResource(MR.images.ic_draft_filled) + History -> painterResource(MR.images.ic_schedule_filled) } fun enableDescription(enabled: GroupFeatureEnabled, canEdit: Boolean): String = @@ -3372,6 +3376,10 @@ enum class GroupFeature: Feature { GroupFeatureEnabled.ON -> generalGetString(MR.strings.allow_to_send_files) GroupFeatureEnabled.OFF -> generalGetString(MR.strings.prohibit_sending_files) } + History -> when(enabled) { + GroupFeatureEnabled.ON -> generalGetString(MR.strings.enable_sending_recent_history) + GroupFeatureEnabled.OFF -> generalGetString(MR.strings.disable_sending_recent_history) + } } } else { when(this) { @@ -3399,6 +3407,10 @@ enum class GroupFeature: Feature { GroupFeatureEnabled.ON -> generalGetString(MR.strings.group_members_can_send_files) GroupFeatureEnabled.OFF -> generalGetString(MR.strings.files_are_prohibited_in_group) } + History -> when(enabled) { + GroupFeatureEnabled.ON -> generalGetString(MR.strings.recent_history_is_sent_to_new_members) + GroupFeatureEnabled.OFF -> generalGetString(MR.strings.recent_history_is_not_sent_to_new_members) + } } } } @@ -3513,6 +3525,7 @@ data class FullGroupPreferences( val reactions: GroupPreference, val voice: GroupPreference, val files: GroupPreference, + val history: GroupPreference, ) { fun toGroupPreferences(): GroupPreferences = GroupPreferences( @@ -3522,6 +3535,7 @@ data class FullGroupPreferences( reactions = reactions, voice = voice, files = files, + history = history ) companion object { @@ -3532,18 +3546,20 @@ data class FullGroupPreferences( reactions = GroupPreference(GroupFeatureEnabled.ON), voice = GroupPreference(GroupFeatureEnabled.ON), files = GroupPreference(GroupFeatureEnabled.ON), + history = GroupPreference(GroupFeatureEnabled.ON), ) } } @Serializable data class GroupPreferences( - val timedMessages: TimedMessagesGroupPreference?, - val directMessages: GroupPreference?, - val fullDelete: GroupPreference?, - val reactions: GroupPreference?, - val voice: GroupPreference?, - val files: GroupPreference?, + val timedMessages: TimedMessagesGroupPreference? = null, + val directMessages: GroupPreference? = null, + val fullDelete: GroupPreference? = null, + val reactions: GroupPreference? = null, + val voice: GroupPreference? = null, + val files: GroupPreference? = null, + val history: GroupPreference? = null, ) { companion object { val sampleData = GroupPreferences( @@ -3553,6 +3569,7 @@ data class GroupPreferences( reactions = GroupPreference(GroupFeatureEnabled.ON), voice = GroupPreference(GroupFeatureEnabled.ON), files = GroupPreference(GroupFeatureEnabled.ON), + history = GroupPreference(GroupFeatureEnabled.ON), ) } } diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/group/GroupPreferences.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/group/GroupPreferences.kt index 3cdfaad2d..bd584f0c8 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/group/GroupPreferences.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/group/GroupPreferences.kt @@ -112,6 +112,11 @@ private fun GroupPreferencesLayout( FeatureSection(GroupFeature.Files, allowFiles, groupInfo, preferences, onTTLUpdated) { applyPrefs(preferences.copy(files = GroupPreference(enable = it))) } + SectionDividerSpaced(true, maxBottomPadding = false) + val enableHistory = remember(preferences) { mutableStateOf(preferences.history.enable) } + FeatureSection(GroupFeature.History, enableHistory, groupInfo, preferences, onTTLUpdated) { + applyPrefs(preferences.copy(history = GroupPreference(enable = it))) + } if (groupInfo.canEdit) { SectionDividerSpaced(maxTopPadding = true, maxBottomPadding = false) ResetSaveButtons( diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/newchat/AddGroupView.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/newchat/AddGroupView.kt index 4f71e81b0..eca579bcc 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/newchat/AddGroupView.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/newchat/AddGroupView.kt @@ -139,7 +139,8 @@ fun AddGroupLayout( createGroup(incognito.value, GroupProfile( displayName = displayName.value.trim(), fullName = "", - image = profileImage.value + image = profileImage.value, + groupPreferences = GroupPreferences(history = GroupPreference(GroupFeatureEnabled.ON)) )) }, textColor = MaterialTheme.colors.primary, diff --git a/apps/multiplatform/common/src/commonMain/resources/MR/base/strings.xml b/apps/multiplatform/common/src/commonMain/resources/MR/base/strings.xml index e30b4eb56..09ccf1e40 100644 --- a/apps/multiplatform/common/src/commonMain/resources/MR/base/strings.xml +++ b/apps/multiplatform/common/src/commonMain/resources/MR/base/strings.xml @@ -1461,6 +1461,7 @@ Message reactions Voice messages Files and media + Visible history Audio/video calls \nAvailable in v5.1 enabled @@ -1473,8 +1474,8 @@ Allow your contacts to send disappearing messages. Allow disappearing messages only if your contact allows them. Prohibit sending disappearing messages. - Allow your contacts to irreversibly delete sent messages. - Allow irreversible message deletion only if your contact allows it to you. + Allow your contacts to irreversibly delete sent messages. (24 hours) + Allow irreversible message deletion only if your contact allows it to you. (24 hours) Contacts can mark messages for deletion; you will be able to view them. Allow your contacts to send voice messages. Allow voice messages only if your contact allows them. @@ -1489,9 +1490,9 @@ Only you can send disappearing messages. Only your contact can send disappearing messages. Disappearing messages are prohibited in this chat. - Both you and your contact can irreversibly delete sent messages. - Only you can irreversibly delete messages (your contact can mark them for deletion). - Only your contact can irreversibly delete messages (you can mark them for deletion). + Both you and your contact can irreversibly delete sent messages. (24 hours) + Only you can irreversibly delete messages (your contact can mark them for deletion). (24 hours) + Only your contact can irreversibly delete messages (you can mark them for deletion). (24 hours) Irreversible message deletion is prohibited in this chat. Both you and your contact can send voice messages. Only you can send voice messages. @@ -1509,7 +1510,7 @@ Prohibit sending disappearing messages. Allow sending direct messages to members. Prohibit sending direct messages to members. - Allow to irreversibly delete sent messages. + Allow to irreversibly delete sent messages. (24 hours) Prohibit irreversible message deletion. Allow to send voice messages. Prohibit sending voice messages. @@ -1517,11 +1518,13 @@ Prohibit messages reactions. Allow to send files and media. Prohibit sending files and media. + Send up to 100 last messages to new members. + Do not send history to new members. Group members can send disappearing messages. Disappearing messages are prohibited in this group. Group members can send direct messages. Direct messages between members are prohibited in this group. - Group members can irreversibly delete sent messages. + Group members can irreversibly delete sent messages. (24 hours) Irreversible message deletion is prohibited in this group. Group members can send voice messages. Voice messages are prohibited in this group. @@ -1529,6 +1532,8 @@ Message reactions are prohibited in this group. Group members can send files and media. Files and media are prohibited in this group. + Up to 100 last messages are sent to new members. + History is not sent to new members. Delete after %d sec %ds diff --git a/apps/multiplatform/common/src/commonMain/resources/MR/images/ic_schedule.svg b/apps/multiplatform/common/src/commonMain/resources/MR/images/ic_schedule.svg new file mode 100644 index 000000000..4bd8e90cb --- /dev/null +++ b/apps/multiplatform/common/src/commonMain/resources/MR/images/ic_schedule.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/apps/multiplatform/common/src/commonMain/resources/MR/images/ic_schedule_filled.svg b/apps/multiplatform/common/src/commonMain/resources/MR/images/ic_schedule_filled.svg new file mode 100644 index 000000000..368e2fcc1 --- /dev/null +++ b/apps/multiplatform/common/src/commonMain/resources/MR/images/ic_schedule_filled.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/Simplex/Chat.hs b/src/Simplex/Chat.hs index 1b61fb748..fb2abf23d 100644 --- a/src/Simplex/Chat.hs +++ b/src/Simplex/Chat.hs @@ -4798,7 +4798,7 @@ processAgentMessageConn vr user@User {userId} corrId agentConnId agentMessage = createGroupFeatureItems :: GroupInfo -> GroupMember -> m () createGroupFeatureItems g@GroupInfo {fullGroupPreferences} m = - forM_ allGroupFeatureItems $ \(AGF f) -> do + forM_ allGroupFeatures $ \(AGF f) -> do let p = getGroupPreference f fullGroupPreferences (_, param) = groupFeatureState p createInternalChatItem user (CDGroupRcv g m) (CIRcvGroupFeature (toGroupFeature f) (toGroupPreference p) param) Nothing @@ -6002,7 +6002,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_ allGroupFeatureItems $ \(AGF f) -> do + forM_ allGroupFeatures $ \(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 18a10a83f..5c79680c5 100644 --- a/src/Simplex/Chat/Types/Preferences.hs +++ b/src/Simplex/Chat/Types/Preferences.hs @@ -184,19 +184,17 @@ groupFeatureAllowed' :: GroupFeatureI f => SGroupFeature f -> FullGroupPreferenc groupFeatureAllowed' feature prefs = getField @"enable" (getGroupPreference feature prefs) == FEOn -allGroupFeatureItems :: [AGroupFeature] -allGroupFeatureItems = +allGroupFeatures :: [AGroupFeature] +allGroupFeatures = [ AGF SGFTimedMessages, AGF SGFDirectMessages, AGF SGFFullDelete, AGF SGFReactions, AGF SGFVoice, - AGF SGFFiles + AGF SGFFiles, + AGF SGFHistory ] -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/Groups.hs b/tests/ChatTests/Groups.hs index 76bc520aa..f90e7f14d 100644 --- a/tests/ChatTests/Groups.hs +++ b/tests/ChatTests/Groups.hs @@ -2681,7 +2681,7 @@ testGroupLinkNoContact = ] threadDelay 100000 - alice #$> ("/_get chat #1 count=100", chat, [(0, "invited via your group link"), (0, "connected")]) + alice #$> ("/_get chat #1 count=100", chat, [(1, "Recent history: off"), (0, "invited via your group link"), (0, "connected")]) alice @@@ [("#team", "connected")] bob @@@ [("#team", "connected")] @@ -2744,7 +2744,7 @@ testGroupLinkNoContactInviteesWereConnected = ] threadDelay 100000 - alice #$> ("/_get chat #1 count=100", chat, [(0, "invited via your group link"), (0, "connected")]) + alice #$> ("/_get chat #1 count=100", chat, [(1, "Recent history: off"), (0, "invited via your group link"), (0, "connected")]) alice @@@ [("#team", "connected")] bob @@@ [("#team", "connected"), ("@cath", "hey")] @@ -2825,7 +2825,7 @@ testGroupLinkNoContactAllMembersWereConnected = ] threadDelay 100000 - alice #$> ("/_get chat #1 count=100", chat, [(0, "invited via your group link"), (0, "connected")]) + alice #$> ("/_get chat #1 count=100", chat, [(1, "Recent history: off"), (0, "invited via your group link"), (0, "connected")]) alice @@@ [("#team", "connected"), ("@bob", "hey"), ("@cath", "hey")] bob @@@ [("#team", "connected"), ("@alice", "hey"), ("@cath", "hey")] diff --git a/tests/ChatTests/Utils.hs b/tests/ChatTests/Utils.hs index 65fa3bc4c..ac87311c9 100644 --- a/tests/ChatTests/Utils.hs +++ b/tests/ChatTests/Utils.hs @@ -223,8 +223,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