Skip to content

Commit

Permalink
1.9.4 (407)
Browse files Browse the repository at this point in the history
  • Loading branch information
denis15yo committed Dec 24, 2024
1 parent 64be65a commit 95002ee
Show file tree
Hide file tree
Showing 11,224 changed files with 1,305,682 additions and 827,226 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,6 @@
[submodule "submodules/LottieCpp/lottiecpp"]
path = submodules/LottieCpp/lottiecpp
url = https://github.com/ali-fareed/lottiecpp.git
[submodule "third-party/dav1d/dav1d"]
path = third-party/dav1d/dav1d
url = https://github.com/ali-fareed/dav1d.git
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.

Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ class NicegramSettingsRepositoryImpl {
grayscaleAll: false,
grayscaleInChat: false,
grayscaleInChatList: false,
trackDigitalFootprint: false,
speechToText: .init(enableApple: nil)
trackDigitalFootprint: false
),
toDomain: \.toDomain,
toDto: \.toDto
Expand All @@ -33,50 +32,19 @@ extension NicegramSettingsRepositoryImpl: NicegramSettingsRepository {
}

private struct NicegramSettingsDto: Codable {
struct SpeechToTextDto: Codable {
let enableApple: Bool?
}

let disableAnimationsInChatList: Bool
let grayscaleAll: Bool
let grayscaleInChat: Bool
let grayscaleInChatList: Bool
let trackDigitalFootprint: Bool
let speechToText: SpeechToTextDto

var toDomain: NicegramSettings {
NicegramSettings(
disableAnimationsInChatList: disableAnimationsInChatList,
grayscaleAll: grayscaleAll,
grayscaleInChat: grayscaleInChat,
grayscaleInChatList: grayscaleInChatList,
trackDigitalFootprint: trackDigitalFootprint,
speechToText: speechToText.toDomain
)
}
}

private extension NicegramSettingsDto.SpeechToTextDto {
var toDomain: NicegramSettings.SpeechToText {
NicegramSettings.SpeechToText(enableApple: enableApple)
NicegramSettings(disableAnimationsInChatList: disableAnimationsInChatList, grayscaleAll: grayscaleAll, grayscaleInChat: grayscaleInChat, grayscaleInChatList: grayscaleInChatList, trackDigitalFootprint: trackDigitalFootprint)
}
}

private extension NicegramSettings {
var toDto: NicegramSettingsDto {
NicegramSettingsDto(
disableAnimationsInChatList: disableAnimationsInChatList,
grayscaleAll: grayscaleAll,
grayscaleInChat: grayscaleInChat,
grayscaleInChatList: grayscaleInChatList,
trackDigitalFootprint: trackDigitalFootprint,
speechToText: speechToText.toDto
)
}
}

private extension NicegramSettings.SpeechToText {
var toDto: NicegramSettingsDto.SpeechToTextDto {
NicegramSettingsDto.SpeechToTextDto(enableApple: enableApple)
NicegramSettingsDto(disableAnimationsInChatList: disableAnimationsInChatList, grayscaleAll: grayscaleAll, grayscaleInChat: grayscaleInChat, grayscaleInChatList: grayscaleInChatList, trackDigitalFootprint: trackDigitalFootprint)
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,11 @@ import Combine
import NGCore

public struct NicegramSettings: Withable {
public struct SpeechToText: Withable {
public var enableApple: Bool?
}

public var disableAnimationsInChatList: Bool
public var grayscaleAll: Bool
public var grayscaleInChat: Bool
public var grayscaleInChatList: Bool
public var trackDigitalFootprint: Bool
public var speechToText: SpeechToText
}

public protocol NicegramSettingsRepository {
Expand Down

This file was deleted.

16 changes: 0 additions & 16 deletions Nicegram/NGData/Sources/Modern/NicegramSettingsModule.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,6 @@ extension NicegramSettingsModule {
)
}
}

public var getSpeech2TextSettingsUseCase: Factory<GetSpeech2TextSettingsUseCase> {
self { [self] in
GetSpeech2TextSettingsUseCase(
nicegramSettingsRepository: nicegramSettingsRepository()
)
}
}

public var setDefaultSpeech2TextSettingsUseCase: Factory<SetDefaultSpeech2TextSettingsUseCase> {
self { [self] in
SetDefaultSpeech2TextSettingsUseCase(
nicegramSettingsRepository: nicegramSettingsRepository()
)
}
}
}

extension NicegramSettingsModule {
Expand Down
20 changes: 8 additions & 12 deletions Nicegram/NGSpeechToText/Sources/ConvertSpeechToText.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,6 @@ public func convertSpeechToText(
return
}
}

guard let id else {
completion?()
return
}

checkPremium { isPremium in
if isPremium &&
Expand All @@ -56,9 +51,9 @@ public func convertSpeechToText(
completion: completion
)
} else {
let locale = NGSettings.appleSpeechToTextLocale[id] ?? Locale.current

if languageStyle == .normal {
if let id,
let locale = NGSettings.appleSpeechToTextLocale[id],
languageStyle == .normal {
startConvertSpeechToTextTask(
from: source,
context: context,
Expand All @@ -79,10 +74,11 @@ public func convertSpeechToText(
style: languageStyle,
currentLocale: currentLocale
) { locale in
var appleSpeechToTextLocale = NGSettings.appleSpeechToTextLocale
appleSpeechToTextLocale[id] = locale
NGSettings.appleSpeechToTextLocale = appleSpeechToTextLocale

if let id {
var appleSpeechToTextLocale = NGSettings.appleSpeechToTextLocale
appleSpeechToTextLocale[id] = locale
NGSettings.appleSpeechToTextLocale = appleSpeechToTextLocale
}
_ = controllerInteraction.navigationController()?.popViewController(animated: true)
startConvertSpeechToTextTask(
from: source,
Expand Down
37 changes: 1 addition & 36 deletions Nicegram/NGUI/Sources/NicegramSettingsController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ private enum NicegramSettingsControllerSection: Int32 {
case QuickReplies
case ShareData
case PinnedChats
case Tools
}


Expand Down Expand Up @@ -128,9 +127,6 @@ 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 @@ -158,8 +154,6 @@ 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 @@ -236,11 +230,6 @@ 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 @@ -249,6 +238,7 @@ private enum NicegramSettingsControllerEntry: ItemListNodeEntry {
return 6002
case .shareDataNote:
return 6010

}
}

Expand Down Expand Up @@ -434,18 +424,6 @@ 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 @@ -679,16 +657,6 @@ 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 @@ -838,9 +806,6 @@ private func nicegramSettingsControllerEntries(presentationData: PresentationDat
entries.append(.easyToggle(toggleIndex, .enableGrayscaleInChat, l("NicegramSettings.EnableGrayscaleInChat"), nicegramSettings.grayscaleInChat))
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
Loading

0 comments on commit 95002ee

Please sign in to comment.