Version 10.13

This commit is contained in:
Kylmakalle
2024-07-02 19:58:37 +03:00
parent 1d1ea447ad
commit 1cfbc5b7cd
634 changed files with 30999 additions and 1244 deletions

View File

@@ -1,5 +1,9 @@
load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library")
sgdeps = [
"//Swiftgram/SGStrings:SGStrings"
]
swift_library(
name = "AuthorizationUI",
module_name = "AuthorizationUI",
@@ -9,7 +13,7 @@ swift_library(
copts = [
"-warnings-as-errors",
],
deps = [
deps = sgdeps + [
"//submodules/AsyncDisplayKit:AsyncDisplayKit",
"//submodules/TelegramCore:TelegramCore",
"//submodules/Postbox:Postbox",

View File

@@ -1,3 +1,5 @@
import SGStrings
import Foundation
import UIKit
import AsyncDisplayKit
@@ -591,11 +593,10 @@ public final class AuthorizationSequenceController: NavigationController, ASAuth
if nextType == nil {
if let controller {
let carrier = CTCarrier()
let mnc = carrier.mobileNetworkCode ?? "none"
let _ = strongSelf.engine.auth.reportMissingCode(phoneNumber: number, phoneCodeHash: phoneCodeHash, mnc: mnc).start()
AuthorizationSequenceController.presentDidNotGetCodeUI(controller: controller, presentationData: strongSelf.presentationData, phoneNumber: number, mnc: mnc)
// MARK: Swiftgram
controller.present(standardTextAlertController(theme: AlertControllerTheme(presentationData: strongSelf.presentationData), title: nil, text: i18n("Auth.UnofficialAppCodeTitle", strongSelf.presentationData.strings.baseLanguageCode), actions: [TextAlertAction(type: .defaultAction, title: i18n("Common.OpenTelegram", strongSelf.presentationData.strings.baseLanguageCode), action: {
strongSelf.sharedContext.applicationBindings.openUrl("https://t.me/+42777")
})]), in: .window(.root))
}
} else {
controller?.inProgress = true

View File

@@ -276,6 +276,11 @@ public final class AuthorizationSequencePhoneEntryController: ViewController, MF
actions.append(TextAlertAction(type: .defaultAction, title: self.presentationData.strings.Common_OK, action: {}))
self.present(standardTextAlertController(theme: AlertControllerTheme(presentationData: self.presentationData), title: nil, text: self.presentationData.strings.Login_PhoneNumberAlreadyAuthorized, actions: actions), in: .window(.root))
} else {
// MARK: Swiftgram
if (number == "0000000000") {
self.sharedContext.beginNewAuth(testingEnvironment: true)
return
}
if let validLayout = self.validLayout, validLayout.size.width > 320.0 {
let (code, formattedNumber) = self.controllerNode.formattedCodeAndNumber

View File

@@ -583,7 +583,7 @@ final class AuthorizationSequencePhoneEntryControllerNode: ASDisplayNode {
}
let contactSyncSize = self.contactSyncNode.updateLayout(width: maximumWidth)
if self.hasOtherAccounts {
if self.hasOtherAccounts || { return true }() {
self.contactSyncNode.isHidden = false
items.append(AuthorizationLayoutItem(node: self.contactSyncNode, size: contactSyncSize, spacingBefore: AuthorizationLayoutItemSpacing(weight: 14.0, maxValue: 14.0), spacingAfter: AuthorizationLayoutItemSpacing(weight: 0.0, maxValue: 0.0)))
} else {