Skip to content

Commit

Permalink
1.9.4 (406)
Browse files Browse the repository at this point in the history
  • Loading branch information
denis15yo committed Dec 23, 2024
1 parent 7967ab6 commit 64be65a
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 41 deletions.
10 changes: 5 additions & 5 deletions MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

51 changes: 36 additions & 15 deletions Nicegram/NGUI/Sources/NicegramSettingsController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ private enum NicegramSettingsControllerSection: Int32 {
case QuickReplies
case ShareData
case PinnedChats
case Tools
}


Expand All @@ -89,7 +90,6 @@ private enum EasyToggleType {
case enableGrayscaleAll
case enableGrayscaleInChatList
case enableGrayscaleInChat
case enableAppleSpeech2Text
}


Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
}
}

Expand Down Expand Up @@ -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:
Expand All @@ -239,7 +249,6 @@ private enum NicegramSettingsControllerEntry: ItemListNodeEntry {
return 6002
case .shareDataNote:
return 6010

}
}

Expand Down Expand Up @@ -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
}
}
}

Expand Down Expand Up @@ -572,10 +593,6 @@ private enum NicegramSettingsControllerEntry: ItemListNodeEntry {
updateNicegramSettings {
$0.grayscaleInChat = value
}
case .enableAppleSpeech2Text:
updateNicegramSettings {
$0.speechToText.enableApple = value
}
}
})
case let .unblockHeader(text):
Expand Down Expand Up @@ -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
})
}
}
}
Expand Down Expand Up @@ -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(
Expand Down
18 changes: 1 addition & 17 deletions Nicegram/NGUI/Sources/PremiumController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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
Expand Down Expand Up @@ -133,8 +131,6 @@ private enum PremiumControllerEntry: ItemListNodeEntry {
return 4000
case .otherHeader:
return 10000
case .onetaptr:
return 11000
case .ignoretr:
return 12000
case .useOpenAI:
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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: {
Expand Down Expand Up @@ -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))
Expand Down
8 changes: 4 additions & 4 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
},
{
Expand Down Expand Up @@ -114,7 +114,7 @@
"location" : "[email protected]:mobyrix/nicegram-assistant-ios.git",
"state" : {
"branch" : "develop",
"revision" : "6186fd244d909c51a2962feabb7a7739a7a70e24"
"revision" : "4df4c2aedcbd228aaf6d9724468a35163a6beb9d"
}
},
{
Expand All @@ -123,7 +123,7 @@
"location" : "[email protected]:mobyrix/nicegram-wallet-ios.git",
"state" : {
"branch" : "develop",
"revision" : "0a5f42377f129c4f10d61d42f30838f50c25f177"
"revision" : "afb5081ee66c4a958d2f6223f08c4f9eb42c01dd"
}
},
{
Expand Down

0 comments on commit 64be65a

Please sign in to comment.