diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index 4f10bf4fd9..eb96c5ecdf 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -633,7 +633,7 @@ "bzlTransitiveDigest": "8/YWyYftd8THfVoADvrOmQLl45wUGfP2MVjLM5FFn50=", "usagesDigest": "voXBMcSNlo2fnK6JIvInIrncYhBKKG8nBeKvToaUA0Y=", "recordedFileInputs": { - "@@//Package.resolved": "92d0441730805d5fd6c619f02bd6e7e5e93149a6a71761f1769097c2a335e4de", + "@@//Package.resolved": "74d60d2f0fb56d4050553c878cce61d39aa95af6e78211d632d95c5924be4b89", "@@//Package.swift": "fb3cb1d48066e64f8bf17fe1a49f689b7a6bf4bfc07aa90b9b80a02188501951" }, "recordedDirentsInputs": {}, @@ -1119,7 +1119,7 @@ "ruleClassName": "swift_package", "attributes": { "bazel_package_name": "swiftpkg_nicegram_assistant_ios", - "commit": "6186fd244d909c51a2962feabb7a7739a7a70e24", + "commit": "4df4c2aedcbd228aaf6d9724468a35163a6beb9d", "remote": "git@bitbucket.org:mobyrix/nicegram-assistant-ios.git", "version": "", "init_submodules": false, @@ -1290,9 +1290,9 @@ "ruleClassName": "swift_package", "attributes": { "bazel_package_name": "swiftpkg_cryptoswift", - "commit": "678d442c6f7828def400a70ae15968aef67ef52d", + "commit": "729e01bc9b9dab466ac85f21fb9ee2bc1c61b258", "remote": "https://github.com/krzyzanowskim/CryptoSwift.git", - "version": "1.8.3", + "version": "1.8.4", "init_submodules": false, "recursive_init_submodules": true, "patch_args": [ @@ -1366,7 +1366,7 @@ "ruleClassName": "swift_package", "attributes": { "bazel_package_name": "swiftpkg_nicegram_wallet_ios", - "commit": "0a5f42377f129c4f10d61d42f30838f50c25f177", + "commit": "afb5081ee66c4a958d2f6223f08c4f9eb42c01dd", "remote": "git@bitbucket.org:mobyrix/nicegram-wallet-ios.git", "version": "", "init_submodules": false, diff --git a/Nicegram/NGUI/Sources/NicegramSettingsController.swift b/Nicegram/NGUI/Sources/NicegramSettingsController.swift index b97cbbf75b..89e93ad276 100644 --- a/Nicegram/NGUI/Sources/NicegramSettingsController.swift +++ b/Nicegram/NGUI/Sources/NicegramSettingsController.swift @@ -72,6 +72,7 @@ private enum NicegramSettingsControllerSection: Int32 { case QuickReplies case ShareData case PinnedChats + case Tools } @@ -89,7 +90,6 @@ private enum EasyToggleType { case enableGrayscaleAll case enableGrayscaleInChatList case enableGrayscaleInChat - case enableAppleSpeech2Text } @@ -128,6 +128,9 @@ private enum NicegramSettingsControllerEntry: ItemListNodeEntry { case quickReplies(String) + case enableAppleSpeech2Text(String, Bool) + case onetaptr(String, Bool) + case shareBotsData(String, Bool) case shareChannelsData(String, Bool) case shareStickersData(String, Bool) @@ -155,6 +158,8 @@ private enum NicegramSettingsControllerEntry: ItemListNodeEntry { return NicegramSettingsControllerSection.ShareData.rawValue case .pinnedChatsHeader, .pinnedChat: return NicegramSettingsControllerSection.PinnedChats.rawValue + case .enableAppleSpeech2Text, .onetaptr: + return NicegramSettingsControllerSection.Tools.rawValue } } @@ -231,6 +236,11 @@ private enum NicegramSettingsControllerEntry: ItemListNodeEntry { case let .easyToggle(index, _, _, _): return 5000 + Int32(index) + case .onetaptr: + return 5900 + case .enableAppleSpeech2Text: + return 5950 + case .shareBotsData: return 6000 case .shareChannelsData: @@ -239,7 +249,6 @@ private enum NicegramSettingsControllerEntry: ItemListNodeEntry { return 6002 case .shareDataNote: return 6010 - } } @@ -425,6 +434,18 @@ private enum NicegramSettingsControllerEntry: ItemListNodeEntry { } else { return false } + case let .enableAppleSpeech2Text(lhsText, lhsValue): + if case let .enableAppleSpeech2Text(rhsText, rhsValue) = rhs, lhsText == rhsText, lhsValue == rhsValue { + return true + } else { + return false + } + case let .onetaptr(lhsText, lhsValue): + if case let .onetaptr(rhsText, rhsValue) = rhs, lhsText == rhsText, lhsValue == rhsValue { + return true + } else { + return false + } } } @@ -572,10 +593,6 @@ private enum NicegramSettingsControllerEntry: ItemListNodeEntry { updateNicegramSettings { $0.grayscaleInChat = value } - case .enableAppleSpeech2Text: - updateNicegramSettings { - $0.speechToText.enableApple = value - } } }) case let .unblockHeader(text): @@ -662,6 +679,16 @@ private enum NicegramSettingsControllerEntry: ItemListNodeEntry { } else { fatalError() } + case let .enableAppleSpeech2Text(text, value): + return ItemListSwitchItem(presentationData: presentationData, title: text, value: value, enabled: true, sectionId: section, style: .blocks, updated: { value in + updateNicegramSettings { + $0.speechToText.enableApple = value + } + }) + case let .onetaptr(text, value): + return ItemListSwitchItem(presentationData: presentationData, title: text, value: value, enabled: true, sectionId: section, style: .blocks, updated: { value in + NGSettings.oneTapTr = value + }) } } } @@ -810,16 +837,10 @@ private func nicegramSettingsControllerEntries(presentationData: PresentationDat entries.append(.easyToggle(toggleIndex, .enableGrayscaleInChat, l("NicegramSettings.EnableGrayscaleInChat"), nicegramSettings.grayscaleInChat)) toggleIndex += 1 - - entries.append( - .easyToggle( - toggleIndex, - .enableAppleSpeech2Text, - l("NicegramSettings.EnableAppleSpeech2Text"), - nicegramSettings.speechToText.enableApple ?? false - )) - toggleIndex += 1 + entries.append(.onetaptr(l("Premium.OnetapTranslate"), NGSettings.oneTapTr)) + entries.append(.enableAppleSpeech2Text(l("NicegramSettings.EnableAppleSpeech2Text"), nicegramSettings.speechToText.enableApple ?? false)) + if let sharingSettings { entries.append( .shareBotsData( diff --git a/Nicegram/NGUI/Sources/PremiumController.swift b/Nicegram/NGUI/Sources/PremiumController.swift index b6b626f41f..fc167e78e5 100644 --- a/Nicegram/NGUI/Sources/PremiumController.swift +++ b/Nicegram/NGUI/Sources/PremiumController.swift @@ -80,8 +80,6 @@ private enum PremiumControllerEntry: ItemListNodeEntry { case otherHeader(PresentationTheme, String) - case onetaptr(PresentationTheme, String, Bool) - case testButton(PresentationTheme, String) case ignoretr(PresentationTheme, String) @@ -98,7 +96,7 @@ private enum PremiumControllerEntry: ItemListNodeEntry { return premiumControllerSection.notifyMissed.rawValue case .manageFiltersHeader, .manageFilters, .rememberFolderOnExit: return premiumControllerSection.manageFilters.rawValue - case .otherHeader, .onetaptr, .ignoretr: + case .otherHeader, .ignoretr: return premiumControllerSection.other.rawValue case .testButton: return premiumControllerSection.test.rawValue @@ -133,8 +131,6 @@ private enum PremiumControllerEntry: ItemListNodeEntry { return 4000 case .otherHeader: return 10000 - case .onetaptr: - return 11000 case .ignoretr: return 12000 case .useOpenAI: @@ -200,13 +196,6 @@ private enum PremiumControllerEntry: ItemListNodeEntry { } else { return false } - - case let .onetaptr(lhsTheme, lhsText, lhsValue): - if case let .onetaptr(rhsTheme, rhsText, rhsValue) = rhs, lhsTheme === rhsTheme, lhsText == rhsText, lhsValue == rhsValue { - return true - } else { - return false - } case let .rememberFolderOnExit(lhsTheme, lhsText, lhsValue): if case let .rememberFolderOnExit(rhsTheme, rhsText, rhsValue) = rhs, lhsTheme === rhsTheme, lhsText == rhsText, lhsValue == rhsValue { @@ -281,10 +270,6 @@ private enum PremiumControllerEntry: ItemListNodeEntry { }) case let .otherHeader(_, text): return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) - case let .onetaptr(_, text, value): - return ItemListSwitchItem(presentationData: presentationData, title: text, value: value, enabled: true, sectionId: self.section, style: .blocks, updated: { value in - arguments.toggleSetting(value, .oneTapTr) - }) case let .testButton(_, _): return ItemListActionItem(presentationData: presentationData, title: "Test Button", kind: .generic, alignment: .natural, sectionId: self.section, style: .blocks, action: { @@ -320,7 +305,6 @@ private func premiumControllerEntries(presentationData: PresentationData) -> [Pr let theme = presentationData.theme entries.append(.rememberFolderOnExit(theme, l("Premium.rememberFolderOnExit"), NGSettings.rememberFolderOnExit)) - entries.append(.onetaptr(theme, l("Premium.OnetapTranslate"), NGSettings.oneTapTr)) entries.append(.ignoretr(theme, l("Premium.IgnoreTranslate.Title"))) entries.append(.useOpenAI(theme, l("SpeechToText.UseOpenAi"), NGSettings.useOpenAI)) diff --git a/Package.resolved b/Package.resolved index 376fd2c72c..2172158d4e 100644 --- a/Package.resolved +++ b/Package.resolved @@ -32,8 +32,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/krzyzanowskim/CryptoSwift.git", "state" : { - "revision" : "678d442c6f7828def400a70ae15968aef67ef52d", - "version" : "1.8.3" + "revision" : "729e01bc9b9dab466ac85f21fb9ee2bc1c61b258", + "version" : "1.8.4" } }, { @@ -114,7 +114,7 @@ "location" : "git@bitbucket.org:mobyrix/nicegram-assistant-ios.git", "state" : { "branch" : "develop", - "revision" : "6186fd244d909c51a2962feabb7a7739a7a70e24" + "revision" : "4df4c2aedcbd228aaf6d9724468a35163a6beb9d" } }, { @@ -123,7 +123,7 @@ "location" : "git@bitbucket.org:mobyrix/nicegram-wallet-ios.git", "state" : { "branch" : "develop", - "revision" : "0a5f42377f129c4f10d61d42f30838f50c25f177" + "revision" : "afb5081ee66c4a958d2f6223f08c4f9eb42c01dd" } }, {