diff --git a/Telegram_Buck.xcworkspace/xcshareddata/xcschemes/Telegram_Buck.xcscheme b/Telegram_Buck.xcworkspace/xcshareddata/xcschemes/Telegram_Buck.xcscheme index b9d704e93d..a3a3833570 100644 --- a/Telegram_Buck.xcworkspace/xcshareddata/xcschemes/Telegram_Buck.xcscheme +++ b/Telegram_Buck.xcworkspace/xcshareddata/xcschemes/Telegram_Buck.xcscheme @@ -2574,8 +2574,6 @@ useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" debugDocumentVersioning = "YES" - stopOnEveryThreadSanitizerIssue = "YES" - stopOnEveryMainThreadCheckerIssue = "YES" debugServiceExtension = "internal" allowLocationSimulation = "YES"> Signal { public func cloudDataAdditionalAddressSource(phoneNumber: Signal) -> Signal { return phoneNumber |> take(1) - |> mapToSignal { _ -> Signal in - let phoneNumber: String? = "7950" + |> mapToSignal { phoneNumber -> Signal in var prefix = "" if let phoneNumber = phoneNumber, phoneNumber.count >= 1 { prefix = String(phoneNumber[phoneNumber.startIndex ..< phoneNumber.index(after: phoneNumber.startIndex)]) diff --git a/submodules/CountrySelectionUI/Sources/AuthorizationSequenceCountrySelectionController.swift b/submodules/CountrySelectionUI/Sources/AuthorizationSequenceCountrySelectionController.swift index e5a634f6de..0f40f80bb1 100644 --- a/submodules/CountrySelectionUI/Sources/AuthorizationSequenceCountrySelectionController.swift +++ b/submodules/CountrySelectionUI/Sources/AuthorizationSequenceCountrySelectionController.swift @@ -83,7 +83,7 @@ private final class AuthorizationSequenceCountrySelectionNavigationContentNode: self.addSubnode(self.searchBar) self.searchBar.cancel = { [weak self] in - self?.searchBar.deactivate(clear: false) + //self?.searchBar.deactivate(clear: false) self?.cancel() } @@ -159,6 +159,8 @@ public final class AuthorizationSequenceCountrySelectionController: ViewControll super.init(navigationBarPresentationData: NavigationBarPresentationData(theme: NavigationBarTheme(rootControllerTheme: theme), strings: NavigationBarStrings(presentationStrings: strings))) + self.navigationPresentation = .modal + self.statusBar.statusBarStyle = theme.rootController.statusBarStyle.style let navigationContentNode = AuthorizationSequenceCountrySelectionNavigationContentNode(theme: theme, strings: strings, cancel: { [weak self] in @@ -191,7 +193,6 @@ public final class AuthorizationSequenceCountrySelectionController: ViewControll override public func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) - self.controllerNode.animateIn() self.navigationContentNode?.activate() } diff --git a/submodules/CountrySelectionUI/Sources/AuthorizationSequenceCountrySelectionControllerNode.swift b/submodules/CountrySelectionUI/Sources/AuthorizationSequenceCountrySelectionControllerNode.swift index 02e1095c8d..6ef8c17e6c 100644 --- a/submodules/CountrySelectionUI/Sources/AuthorizationSequenceCountrySelectionControllerNode.swift +++ b/submodules/CountrySelectionUI/Sources/AuthorizationSequenceCountrySelectionControllerNode.swift @@ -111,7 +111,6 @@ final class AuthorizationSequenceCountrySelectionControllerNode: ASDisplayNode, } self.sections = sections var sectionTitles = sections.map { $0.0 } - sectionTitles.insert(UITableView.indexSearch, at: 0) self.sectionTitles = sectionTitles super.init() diff --git a/submodules/Display/Display/ActionSheetController.swift b/submodules/Display/Display/ActionSheetController.swift index 8fd76c318a..790465062a 100644 --- a/submodules/Display/Display/ActionSheetController.swift +++ b/submodules/Display/Display/ActionSheetController.swift @@ -25,6 +25,7 @@ open class ActionSheetController: ViewController, PresentableController, Standal super.init(navigationBarPresentationData: nil) + self.statusBar.statusBarStyle = .Ignore self.blocksBackgroundWhenInOverlay = true } diff --git a/submodules/Display/Display/Navigation/NavigationContainer.swift b/submodules/Display/Display/Navigation/NavigationContainer.swift index 69ef112ad3..975497b759 100644 --- a/submodules/Display/Display/Navigation/NavigationContainer.swift +++ b/submodules/Display/Display/Navigation/NavigationContainer.swift @@ -173,7 +173,11 @@ final class NavigationContainer: ASDisplayNode, UIGestureRecognizerDelegate { topController.viewWillDisappear(true) let topNode = topController.displayNode - bottomController.containerLayoutUpdated(layout.withUpdatedInputHeight(nil), transition: .immediate) + var bottomControllerLayout = layout + if bottomController.view.disableAutomaticKeyboardHandling.isEmpty { + bottomControllerLayout = bottomControllerLayout.withUpdatedInputHeight(nil) + } + bottomController.containerLayoutUpdated(bottomControllerLayout, transition: .immediate) bottomController.viewWillAppear(true) let bottomNode = bottomController.displayNode @@ -274,7 +278,11 @@ final class NavigationContainer: ASDisplayNode, UIGestureRecognizerDelegate { } else { transitionType = .pop } - self.state.pending = PendingChild(value: self.makeChild(layout: layout.withUpdatedInputHeight(nil), value: last), transitionType: transitionType, transition: transition, update: { [weak self] pendingChild in + var updatedLayout = layout + if last.view.disableAutomaticKeyboardHandling.isEmpty { + updatedLayout = updatedLayout.withUpdatedInputHeight(nil) + } + self.state.pending = PendingChild(value: self.makeChild(layout: updatedLayout, value: last), transitionType: transitionType, transition: transition, update: { [weak self] pendingChild in self?.pendingChildIsReady(pendingChild) }) } @@ -289,7 +297,11 @@ final class NavigationContainer: ASDisplayNode, UIGestureRecognizerDelegate { self.state.pending = nil let previous = self.state.top self.state.top = pending.value - self.topTransition(from: previous, to: pending.value, transitionType: pending.transitionType, layout: layout.withUpdatedInputHeight(nil), transition: pending.transition) + var updatedLayout = layout + if pending.value.value.view.disableAutomaticKeyboardHandling.isEmpty { + updatedLayout = updatedLayout.withUpdatedInputHeight(nil) + } + self.topTransition(from: previous, to: pending.value, transitionType: pending.transitionType, layout: updatedLayout, transition: pending.transition) statusBarTransition = pending.transition if !self.isReady { self.isReady = true @@ -307,7 +319,7 @@ final class NavigationContainer: ASDisplayNode, UIGestureRecognizerDelegate { var updatedStatusBarStyle = self.statusBarStyle if let top = self.state.top { var updatedLayout = layout - if let topTransition = self.state.transition { + if let topTransition = self.state.transition, top.value.view.disableAutomaticKeyboardHandling.isEmpty { updatedLayout = updatedLayout.withUpdatedInputHeight(nil) } self.applyLayout(layout: updatedLayout, to: top, isMaster: true, transition: transition) @@ -408,7 +420,10 @@ final class NavigationContainer: ASDisplayNode, UIGestureRecognizerDelegate { } private func makeChild(layout: ContainerViewLayout, value: ViewController) -> Child { - let updatedLayout = layout.withUpdatedInputHeight(nil) + var updatedLayout = layout + if value.view.disableAutomaticKeyboardHandling.isEmpty { + updatedLayout = updatedLayout.withUpdatedInputHeight(nil) + } value.containerLayoutUpdated(updatedLayout, transition: .immediate) return Child(value: value, layout: updatedLayout) } @@ -430,7 +445,7 @@ final class NavigationContainer: ASDisplayNode, UIGestureRecognizerDelegate { break } if updatedLayout.inputHeight != nil { - if !self.canHaveKeyboardFocus { + if !self.canHaveKeyboardFocus && child.value.view.disableAutomaticKeyboardHandling.isEmpty { updatedLayout = updatedLayout.withUpdatedInputHeight(nil) } } @@ -439,7 +454,7 @@ final class NavigationContainer: ASDisplayNode, UIGestureRecognizerDelegate { shouldSyncKeyboard = true } - if updatedLayout.inputHeight != nil { + if updatedLayout.inputHeight != nil && child.value.view.disableAutomaticKeyboardHandling.isEmpty { if !self.canHaveKeyboardFocus || self.ignoreInputHeight { updatedLayout = updatedLayout.withUpdatedInputHeight(nil) } diff --git a/submodules/Display/Display/Navigation/NavigationController.swift b/submodules/Display/Display/Navigation/NavigationController.swift index 8d1e364fe0..ea862cf43e 100644 --- a/submodules/Display/Display/Navigation/NavigationController.swift +++ b/submodules/Display/Display/Navigation/NavigationController.swift @@ -1078,7 +1078,7 @@ open class NavigationController: UINavigationController, ContainableController, } if let layout = self.validLayout { self.containerLayoutUpdated(layout, transition: transition) - inCallStatusBar.updateState(statusBar: nil, withSafeInsets: false, inCallText: forceInCallStatusBarText, animated: false) + inCallStatusBar.updateState(statusBar: nil, withSafeInsets: !layout.safeInsets.top.isZero, inCallText: forceInCallStatusBarText, animated: false) } } else if let inCallStatusBar = self.inCallStatusBar { self.inCallStatusBar = nil diff --git a/submodules/InstantPageUI/Sources/InstantPageReferenceController.swift b/submodules/InstantPageUI/Sources/InstantPageReferenceController.swift index 2f89939908..02ef3e2080 100644 --- a/submodules/InstantPageUI/Sources/InstantPageReferenceController.swift +++ b/submodules/InstantPageUI/Sources/InstantPageReferenceController.swift @@ -52,8 +52,6 @@ final class InstantPageReferenceController: ViewController { override public func loadView() { super.loadView() - - self.statusBar.removeFromSupernode() } override public func viewDidAppear(_ animated: Bool) { diff --git a/submodules/JoinLinkPreviewUI/Sources/JoinLinkPreviewController.swift b/submodules/JoinLinkPreviewUI/Sources/JoinLinkPreviewController.swift index 692cf1e83f..7332e5b9ac 100644 --- a/submodules/JoinLinkPreviewUI/Sources/JoinLinkPreviewController.swift +++ b/submodules/JoinLinkPreviewUI/Sources/JoinLinkPreviewController.swift @@ -31,6 +31,8 @@ public final class JoinLinkPreviewController: ViewController { self.presentationData = context.sharedContext.currentPresentationData.with { $0 } super.init(navigationBarPresentationData: nil) + + self.statusBar.statusBarStyle = .Ignore } required public init(coder aDecoder: NSCoder) { @@ -76,8 +78,6 @@ public final class JoinLinkPreviewController: ViewController { override public func loadView() { super.loadView() - - self.statusBar.removeFromSupernode() } override public func viewDidAppear(_ animated: Bool) { diff --git a/submodules/LanguageLinkPreviewUI/Sources/LanguageLinkPreviewController.swift b/submodules/LanguageLinkPreviewUI/Sources/LanguageLinkPreviewController.swift index ad210a0ce0..1d604ca476 100644 --- a/submodules/LanguageLinkPreviewUI/Sources/LanguageLinkPreviewController.swift +++ b/submodules/LanguageLinkPreviewUI/Sources/LanguageLinkPreviewController.swift @@ -30,6 +30,8 @@ public final class LanguageLinkPreviewController: ViewController { self.presentationData = context.sharedContext.currentPresentationData.with { $0 } super.init(navigationBarPresentationData: nil) + + self.statusBar.statusBarStyle = .Ignore } required public init(coder aDecoder: NSCoder) { @@ -85,8 +87,6 @@ public final class LanguageLinkPreviewController: ViewController { override public func loadView() { super.loadView() - - self.statusBar.removeFromSupernode() } override public func viewDidAppear(_ animated: Bool) { diff --git a/submodules/LegacyComponents/LegacyComponents/TGCameraController.m b/submodules/LegacyComponents/LegacyComponents/TGCameraController.m index 6c104bdb28..37b5a2b97b 100644 --- a/submodules/LegacyComponents/LegacyComponents/TGCameraController.m +++ b/submodules/LegacyComponents/LegacyComponents/TGCameraController.m @@ -739,7 +739,7 @@ static CGPoint TGCameraControllerClampPointToScreenSize(__unused id self, __unus [UIView animateWithDuration:0.3f animations:^ { - [_context setApplicationStatusBarAlpha:1.0f]; + //[_context setApplicationStatusBarAlpha:1.0f]; }]; } @@ -1816,7 +1816,7 @@ static CGPoint TGCameraControllerClampPointToScreenSize(__unused id self, __unus [UIView animateWithDuration:0.3f animations:^ { - [_context setApplicationStatusBarAlpha:1.0f]; + //[_context setApplicationStatusBarAlpha:1.0f]; }]; [self setInterfaceHidden:true animated:true]; @@ -1892,7 +1892,7 @@ static CGPoint TGCameraControllerClampPointToScreenSize(__unused id self, __unus { _finishedWithResult = true; - [_context setApplicationStatusBarAlpha:1.0f]; + //[_context setApplicationStatusBarAlpha:1.0f]; self.view.hidden = true; diff --git a/submodules/MtProtoKit/MTBackupAddressSignals.m b/submodules/MtProtoKit/MTBackupAddressSignals.m index db3a478091..94dec7b1e7 100644 --- a/submodules/MtProtoKit/MTBackupAddressSignals.m +++ b/submodules/MtProtoKit/MTBackupAddressSignals.m @@ -71,19 +71,23 @@ static NSData *base64_decode(NSString *str) { + (MTSignal *)fetchBackupIpsResolveGoogle:(bool)isTesting phoneNumber:(NSString *)phoneNumber currentContext:(MTContext *)currentContext addressOverride:(NSString *)addressOverride { NSArray *hosts = @[ - @"google.com", - @"www.google.com", - @"google.ru" + @[@"dns.google.com", @""], + @[@"www.google.com", @"dns.google.com"], ]; - NSDictionary *headers = @{@"Host": @"dns.google.com"}; NSMutableArray *signals = [[NSMutableArray alloc] init]; - for (NSString *host in hosts) { + for (NSArray *hostAndHostname in hosts) { + NSString *host = hostAndHostname[0]; + NSString *hostName = hostAndHostname[1]; + NSMutableDictionary *headers = [[NSMutableDictionary alloc] init]; + if ([hostName length] != 0) { + headers[@"Host"] = hostName; + } NSString *apvHost = @"apv3.stel.com"; if (addressOverride != nil) { apvHost = addressOverride; } - MTSignal *signal = [[[MTHttpRequestOperation dataForHttpUrl:[NSURL URLWithString:[NSString stringWithFormat:@"https://%@/resolve?name=%@&type=16", host, isTesting ? @"tapv3.stel.com" : apvHost]] headers:headers] mapToSignal:^MTSignal *(NSData *data) { + MTSignal *signal = [[[MTHttpRequestOperation dataForHttpUrl:[NSURL URLWithString:[NSString stringWithFormat:@"https://%@/resolve?name=%@&type=16&random_padding=%@", host, isTesting ? @"tapv3.stel.com" : apvHost, makeRandomPadding()]] headers:headers] mapToSignal:^MTSignal *(NSData *data) { NSDictionary *dict = [NSJSONSerialization JSONObjectWithData:data options:0 error:nil]; if ([dict respondsToSelector:@selector(objectForKey:)]) { NSArray *answer = dict[@"Answer"]; @@ -132,6 +136,90 @@ static NSData *base64_decode(NSString *str) { return [[MTSignal mergeSignals:signals] take:1]; } +static NSString *makeRandomPadding() { + char validCharacters[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; + int maxIndex = sizeof(validCharacters) - 1; + + int minPadding = 13; + int maxPadding = 128; + int padding = minPadding + arc4random_uniform(maxPadding - minPadding); + NSMutableData *result = [[NSMutableData alloc] initWithLength:padding]; + for (NSUInteger i = 0; i < result.length; i++) { + int index = arc4random_uniform(maxIndex); + assert(index >= 0 && index < maxIndex); + ((uint8_t *)(result.mutableBytes))[i] = validCharacters[index]; + } + NSString *string = [[NSString alloc] initWithData:result encoding:NSUTF8StringEncoding]; + return string; +} + ++ (MTSignal *)fetchBackupIpsResolveCloudflare:(bool)isTesting phoneNumber:(NSString *)phoneNumber currentContext:(MTContext *)currentContext addressOverride:(NSString *)addressOverride { + NSArray *hosts = @[ + @[@"mozilla.cloudflare-dns.com", @""], + ]; + + NSMutableArray *signals = [[NSMutableArray alloc] init]; + for (NSArray *hostAndHostname in hosts) { + NSString *host = hostAndHostname[0]; + NSString *hostName = hostAndHostname[1]; + NSMutableDictionary *headers = [[NSMutableDictionary alloc] init]; + headers[@"accept"] = @"application/dns-json"; + if ([hostName length] != 0) { + headers[@"Host"] = hostName; + } + NSString *apvHost = @"apv3.stel.com"; + if (addressOverride != nil) { + apvHost = addressOverride; + } + MTSignal *signal = [[[MTHttpRequestOperation dataForHttpUrl:[NSURL URLWithString:[NSString stringWithFormat:@"https://%@/dns-query?name=%@&type=16&random_padding=%@", host, isTesting ? @"tapv3.stel.com" : apvHost, makeRandomPadding()]] headers:headers] mapToSignal:^MTSignal *(NSData *data) { + NSDictionary *dict = [NSJSONSerialization JSONObjectWithData:data options:0 error:nil]; + if ([dict respondsToSelector:@selector(objectForKey:)]) { + NSArray *answer = dict[@"Answer"]; + NSMutableArray *strings = [[NSMutableArray alloc] init]; + if ([answer respondsToSelector:@selector(objectAtIndex:)]) { + for (NSDictionary *value in answer) { + if ([value respondsToSelector:@selector(objectForKey:)]) { + NSString *part = value[@"data"]; + if ([part respondsToSelector:@selector(characterAtIndex:)]) { + [strings addObject:part]; + } + } + } + [strings sortUsingComparator:^NSComparisonResult(NSString *lhs, NSString *rhs) { + if (lhs.length > rhs.length) { + return NSOrderedAscending; + } else { + return NSOrderedDescending; + } + }]; + + NSString *finalString = @""; + for (NSString *string in strings) { + finalString = [finalString stringByAppendingString:[string stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"="]]]; + } + + NSData *result = base64_decode(finalString); + NSMutableData *finalData = [[NSMutableData alloc] initWithData:result]; + [finalData setLength:256]; + MTBackupDatacenterData *datacenterData = MTIPDataDecode(finalData, phoneNumber); + if (datacenterData != nil && [self checkIpData:datacenterData timestamp:(int32_t)[currentContext globalTime] source:@"resolveCloudflare"]) { + return [MTSignal single:datacenterData]; + } + } + } + return [MTSignal complete]; + }] catch:^MTSignal *(__unused id error) { + return [MTSignal complete]; + }]; + if (signals.count != 0) { + signal = [signal delay:signals.count onQueue:[[MTQueue alloc] init]]; + } + [signals addObject:signal]; + } + + return [[MTSignal mergeSignals:signals] take:1]; +} + + (MTSignal *)fetchConfigFromAddress:(MTBackupDatacenterAddress *)address currentContext:(MTContext *)currentContext { MTApiEnvironment *apiEnvironment = [currentContext.apiEnvironment copy]; @@ -209,12 +297,23 @@ static NSData *base64_decode(NSString *str) { + (MTSignal * _Nonnull)fetchBackupIps:(bool)isTestingEnvironment currentContext:(MTContext * _Nonnull)currentContext additionalSource:(MTSignal * _Nullable)additionalSource phoneNumber:(NSString * _Nullable)phoneNumber { NSMutableArray *signals = [[NSMutableArray alloc] init]; - [signals addObject:[self fetchBackupIpsResolveGoogle:isTestingEnvironment phoneNumber:phoneNumber currentContext:currentContext addressOverride:currentContext.apiEnvironment.accessHostOverride]]; + //[signals addObject:[self fetchBackupIpsResolveGoogle:isTestingEnvironment phoneNumber:phoneNumber currentContext:currentContext addressOverride:currentContext.apiEnvironment.accessHostOverride]]; + //[signals addObject:[self fetchBackupIpsResolveCloudflare:isTestingEnvironment phoneNumber:phoneNumber currentContext:currentContext addressOverride:currentContext.apiEnvironment.accessHostOverride]]; if (additionalSource != nil) { /*#if DEBUG [signals removeAllObjects]; #endif*/ - [signals addObject:additionalSource]; + [signals addObject:[additionalSource mapToSignal:^MTSignal *(MTBackupDatacenterData *datacenterData) { + if (![datacenterData isKindOfClass:[MTBackupDatacenterData class]]) { + return [MTSignal complete]; + } + MTBackupDatacenterData *datacenterData = MTIPDataDecode(finalData, phoneNumber); + if (datacenterData != nil && [self checkIpData:datacenterData timestamp:(int32_t)[currentContext globalTime] source:@"resolveExternal"]) { + return [MTSignal single:datacenterData]; + } else { + return [MTSignal complete]; + } + }]]; } return [[[MTSignal mergeSignals:signals] take:1] mapToSignal:^MTSignal *(MTBackupDatacenterData *data) { diff --git a/submodules/MtProtoKit/MTProtoKit/MTHttpRequestOperation.m b/submodules/MtProtoKit/MTProtoKit/MTHttpRequestOperation.m index 82ddcb0f82..0e1a47f41b 100644 --- a/submodules/MtProtoKit/MTProtoKit/MTHttpRequestOperation.m +++ b/submodules/MtProtoKit/MTProtoKit/MTHttpRequestOperation.m @@ -36,7 +36,7 @@ [subscriber putCompletion]; } failure:^(__unused NSOperation *operation, __unused NSError *error) { - [subscriber putError:nil]; + [subscriber putError:error]; }]; [operation start]; diff --git a/submodules/SettingsUI/Sources/EditSettingsController.swift b/submodules/SettingsUI/Sources/EditSettingsController.swift index ee04356ba7..05cecda448 100644 --- a/submodules/SettingsUI/Sources/EditSettingsController.swift +++ b/submodules/SettingsUI/Sources/EditSettingsController.swift @@ -447,7 +447,7 @@ func editSettingsController(context: AccountContext, currentName: ItemListAvatar (controller?.navigationController as? NavigationController)?.pushViewController(value) } presentControllerImpl = { [weak controller] value, arguments in - controller?.present(value, in: .window(.root), with: arguments ?? ViewControllerPresentationArguments(presentationAnimation: .modalSheet)) + controller?.present(value, in: .window(.root), with: arguments) } dismissImpl = { [weak controller] in let _ = (controller?.navigationController as? NavigationController)?.popViewController(animated: true) diff --git a/submodules/ShareController/Sources/ShareController.swift b/submodules/ShareController/Sources/ShareController.swift index 086182f34c..2b9b0f6026 100644 --- a/submodules/ShareController/Sources/ShareController.swift +++ b/submodules/ShareController/Sources/ShareController.swift @@ -203,6 +203,11 @@ public final class ShareController: ViewController { return self.displayNode as! ShareControllerNode } + private let _ready = Promise() + override public var ready: Promise { + return self._ready + } + private var animatedIn = false private let sharedContext: SharedAccountContext @@ -242,6 +247,8 @@ public final class ShareController: ViewController { super.init(navigationBarPresentationData: nil) + self.statusBar.statusBarStyle = .Ignore + switch subject { case let .url(text): self.defaultAction = ShareControllerAction(title: self.presentationData.strings.ShareMenu_CopyShareLink, action: { [weak self] in @@ -567,7 +574,7 @@ public final class ShareController: ViewController { return .preparing case let .done(items): if let strongSelf = self, !items.isEmpty { - strongSelf.ready.set(.single(true)) + strongSelf._ready.set(.single(true)) var activityItems: [Any] = [] for item in items { switch item { @@ -632,13 +639,11 @@ public final class ShareController: ViewController { strongSelf.controllerNode.updatePeers(account: strongSelf.currentAccount, switchableAccounts: strongSelf.switchableAccounts, peers: next.0, accountPeer: next.1, defaultAction: strongSelf.defaultAction) } })) - self.ready.set(self.controllerNode.ready.get()) + self._ready.set(self.controllerNode.ready.get()) } override public func loadView() { super.loadView() - - self.statusBar.removeFromSupernode() } override public func viewDidAppear(_ animated: Bool) { diff --git a/submodules/TelegramCore/TelegramCore/Network.swift b/submodules/TelegramCore/TelegramCore/Network.swift index 29c8b45d51..42ff256212 100644 --- a/submodules/TelegramCore/TelegramCore/Network.swift +++ b/submodules/TelegramCore/TelegramCore/Network.swift @@ -500,7 +500,7 @@ func initializedNetwork(arguments: NetworkInitializationArguments, supplementary context.setDiscoverBackupAddressListSignal(MTBackupAddressSignals.fetchBackupIps(testingEnvironment, currentContext: context, additionalSource: wrappedAdditionalSource, phoneNumber: phoneNumber)) #if DEBUG - //let _ = MTBackupAddressSignals.fetchBackupIps(testingEnvironment, currentContext: context, additionalSource: wrappedAdditionalSource, phoneNumber: phoneNumber).start(next: nil) + let _ = MTBackupAddressSignals.fetchBackupIps(testingEnvironment, currentContext: context, additionalSource: wrappedAdditionalSource, phoneNumber: phoneNumber).start(next: nil) #endif let mtProto = MTProto(context: context, datacenterId: datacenterId, usageCalculationInfo: usageCalculationInfo(basePath: basePath, category: nil))! diff --git a/submodules/TelegramUI/TelegramUI/AuthorizationSequenceCodeEntryController.swift b/submodules/TelegramUI/TelegramUI/AuthorizationSequenceCodeEntryController.swift index 7f894be7a6..f82156a376 100644 --- a/submodules/TelegramUI/TelegramUI/AuthorizationSequenceCodeEntryController.swift +++ b/submodules/TelegramUI/TelegramUI/AuthorizationSequenceCodeEntryController.swift @@ -70,6 +70,8 @@ final class AuthorizationSequenceCodeEntryController: ViewController { self.displayNode = AuthorizationSequenceCodeEntryControllerNode(strings: self.strings, theme: self.theme) self.displayNodeDidLoad() + self.controllerNode.view.disableAutomaticKeyboardHandling = [.forward, .backward] + self.controllerNode.loginWithCode = { [weak self] code in self?.continueWithCode(code) } diff --git a/submodules/TelegramUI/TelegramUI/AuthorizationSequencePasswordEntryController.swift b/submodules/TelegramUI/TelegramUI/AuthorizationSequencePasswordEntryController.swift index 5d6523cc89..8c744c5e3b 100644 --- a/submodules/TelegramUI/TelegramUI/AuthorizationSequencePasswordEntryController.swift +++ b/submodules/TelegramUI/TelegramUI/AuthorizationSequencePasswordEntryController.swift @@ -74,6 +74,8 @@ final class AuthorizationSequencePasswordEntryController: ViewController { self.displayNode = AuthorizationSequencePasswordEntryControllerNode(strings: self.strings, theme: self.theme) self.displayNodeDidLoad() + self.controllerNode.view.disableAutomaticKeyboardHandling = [.forward, .backward] + self.controllerNode.loginWithCode = { [weak self] _ in self?.nextPressed() } diff --git a/submodules/TelegramUI/TelegramUI/AuthorizationSequencePhoneEntryController.swift b/submodules/TelegramUI/TelegramUI/AuthorizationSequencePhoneEntryController.swift index 5321ea1cab..cc5f9298be 100644 --- a/submodules/TelegramUI/TelegramUI/AuthorizationSequencePhoneEntryController.swift +++ b/submodules/TelegramUI/TelegramUI/AuthorizationSequencePhoneEntryController.swift @@ -106,6 +106,9 @@ final class AuthorizationSequencePhoneEntryController: ViewController { self.controllerNode.codeAndNumber = (code, name, number) } self.displayNodeDidLoad() + + self.controllerNode.view.disableAutomaticKeyboardHandling = [.forward, .backward] + self.controllerNode.selectCountryCode = { [weak self] in if let strongSelf = self { let controller = AuthorizationSequenceCountrySelectionController(strings: strongSelf.strings, theme: strongSelf.theme) @@ -118,8 +121,7 @@ final class AuthorizationSequencePhoneEntryController: ViewController { controller.dismissed = { self?.controllerNode.activateInput() } - strongSelf.controllerNode.view.endEditing(true) - strongSelf.present(controller, in: .window(.root)) + strongSelf.push(controller) } } self.controllerNode.checkPhone = { [weak self] in diff --git a/submodules/TelegramUI/TelegramUI/AuthorizationSequenceSignUpController.swift b/submodules/TelegramUI/TelegramUI/AuthorizationSequenceSignUpController.swift index e7d751f90f..11ccd23f80 100644 --- a/submodules/TelegramUI/TelegramUI/AuthorizationSequenceSignUpController.swift +++ b/submodules/TelegramUI/TelegramUI/AuthorizationSequenceSignUpController.swift @@ -93,6 +93,8 @@ final class AuthorizationSequenceSignUpController: ViewController { }) self.displayNodeDidLoad() + self.controllerNode.view.disableAutomaticKeyboardHandling = [.forward, .backward] + self.controllerNode.signUpWithName = { [weak self] _, _ in self?.nextPressed() } diff --git a/submodules/TelegramUI/TelegramUI/ChatScheduleTimeController.swift b/submodules/TelegramUI/TelegramUI/ChatScheduleTimeController.swift index 36a6aea0d8..6d3c765d1b 100644 --- a/submodules/TelegramUI/TelegramUI/ChatScheduleTimeController.swift +++ b/submodules/TelegramUI/TelegramUI/ChatScheduleTimeController.swift @@ -38,6 +38,8 @@ final class ChatScheduleTimeController: ViewController { super.init(navigationBarPresentationData: nil) + self.statusBar.statusBarStyle = .Ignore + self.blocksBackgroundWhenInOverlay = true self.presentationDataDisposable = (context.sharedContext.presentationData @@ -74,8 +76,6 @@ final class ChatScheduleTimeController: ViewController { override public func loadView() { super.loadView() - - self.statusBar.removeFromSupernode() } override public func viewDidAppear(_ animated: Bool) { diff --git a/submodules/TelegramUI/TelegramUI/OverlayAudioPlayerController.swift b/submodules/TelegramUI/TelegramUI/OverlayAudioPlayerController.swift index 22ebc5062e..49468c7175 100644 --- a/submodules/TelegramUI/TelegramUI/OverlayAudioPlayerController.swift +++ b/submodules/TelegramUI/TelegramUI/OverlayAudioPlayerController.swift @@ -79,8 +79,6 @@ final class OverlayAudioPlayerControllerImpl: ViewController, OverlayAudioPlayer override public func loadView() { super.loadView() - - self.statusBar.removeFromSupernode() } override public func viewDidAppear(_ animated: Bool) {