Merge branch 'master' into buildbox

This commit is contained in:
Peter 2019-03-26 18:06:40 +04:00
commit ba708277fb
15 changed files with 147 additions and 127 deletions

View File

@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>5.5</string>
<string>5.5.1</string>
<key>CFBundleVersion</key>
<string>${BUILD_NUMBER}</string>
<key>NSExtension</key>

View File

@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>5.5</string>
<string>5.5.1</string>
<key>CFBundleVersion</key>
<string>${BUILD_NUMBER}</string>
<key>NSExtension</key>

View File

@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>5.5</string>
<string>5.5.1</string>
<key>CFBundleVersion</key>
<string>${BUILD_NUMBER}</string>
<key>NSExtension</key>

View File

@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>5.5</string>
<string>5.5.1</string>
<key>CFBundleVersion</key>
<string>${BUILD_NUMBER}</string>
<key>NSExtension</key>

View File

@ -120,7 +120,7 @@ private enum QueuedWakeup: Int32 {
case backgroundLocation
}
private final class SharedApplicationContext {
final class SharedApplicationContext {
let sharedContext: SharedAccountContext
let notificationManager: SharedNotificationManager
let wakeupManager: SharedWakeupManager
@ -571,14 +571,18 @@ private final class SharedApplicationContext {
self.window?.rootViewController?.dismiss(animated: true, completion: nil)
})
// Move back to signal
let accountManagerSignal = Signal<AccountManager, NoError> { subscriber in
let accountManager = AccountManager(basePath: rootPath + "/accounts-metadata")
let upgradeSemaphore = DispatchSemaphore(value: 0)
let _ = upgradedAccounts(accountManager: accountManager, rootPath: rootPath).start(completed: {
upgradeSemaphore.signal()
return upgradedAccounts(accountManager: accountManager, rootPath: rootPath).start(completed: {
subscriber.putNext(accountManager)
subscriber.putCompletion()
})
upgradeSemaphore.wait()
return EmptyDisposable
}
let sharedContextSignal = accountManagerSignal
|> deliverOnMainQueue
|> mapToSignal { accountManager -> Signal<(SharedApplicationContext, LoggingSettings), NoError> in
var initialPresentationDataAndSettings: InitialPresentationDataAndSettings?
let semaphore = DispatchSemaphore(value: 0)
let _ = currentPresentationDataAndSettings(accountManager: accountManager).start(next: { value in
@ -681,15 +685,17 @@ private final class SharedApplicationContext {
return .single(nil)
}
}
let wakeupManager = SharedWakeupManager(beginBackgroundTask: { name, expiration in application.beginBackgroundTask(withName: name, expirationHandler: expiration) }, endBackgroundTask: { id in application.endBackgroundTask(id) }, backgroundTimeRemaining: { application.backgroundTimeRemaining }, activeAccounts: sharedContext.activeAccounts |> map { ($0.0, $0.1.map { ($0.0, $0.1) }) }, liveLocationPolling: liveLocationPolling, watchTasks: watchTasks, inForeground: applicationBindings.applicationInForeground, hasActiveAudioSession: hasActiveAudioSession.get(), notificationManager: notificationManager, mediaManager: sharedContext.mediaManager, callManager: sharedContext.callManager, accountUserInterfaceInUse: { id in
let wakeupManager = SharedWakeupManager(beginBackgroundTask: { name, expiration in application.beginBackgroundTask(withName: name, expirationHandler: expiration) }, endBackgroundTask: { id in application.endBackgroundTask(id) }, backgroundTimeRemaining: { application.backgroundTimeRemaining }, activeAccounts: sharedContext.activeAccounts |> map { ($0.0, $0.1.map { ($0.0, $0.1) }) }, liveLocationPolling: liveLocationPolling, watchTasks: watchTasks, inForeground: applicationBindings.applicationInForeground, hasActiveAudioSession: self.hasActiveAudioSession.get(), notificationManager: notificationManager, mediaManager: sharedContext.mediaManager, callManager: sharedContext.callManager, accountUserInterfaceInUse: { id in
return sharedContext.accountUserInterfaceInUse(id)
})
let sharedApplicationContext = SharedApplicationContext(sharedContext: sharedContext, notificationManager: notificationManager, wakeupManager: wakeupManager)
sharedApplicationContext.sharedContext.mediaManager.overlayMediaManager.attachOverlayMediaController(sharedApplicationContext.overlayMediaController)
self.sharedContextPromise.set(
accountManager.transaction { transaction -> (SharedApplicationContext, LoggingSettings) in
return accountManager.transaction { transaction -> (SharedApplicationContext, LoggingSettings) in
return (sharedApplicationContext, transaction.getSharedData(SharedDataKeys.loggingSettings) as? LoggingSettings ?? LoggingSettings.defaultSettings)
}
}
self.sharedContextPromise.set(sharedContextSignal
|> mapToSignal { sharedApplicationContext, loggingSettings -> Signal<SharedApplicationContext, NoError> in
Logger.shared.logToFile = loggingSettings.logToFile
Logger.shared.logToConsole = loggingSettings.logToConsole
@ -793,7 +799,7 @@ private final class SharedApplicationContext {
|> map { accountAndSettings -> AuthorizedApplicationContext? in
return accountAndSettings.flatMap { account, limitsConfiguration, callListSettings in
let context = AccountContext(sharedContext: sharedApplicationContext.sharedContext, account: account, limitsConfiguration: limitsConfiguration)
return AuthorizedApplicationContext(mainWindow: self.mainWindow, watchManagerArguments: watchManagerArgumentsPromise.get(), context: context, accountManager: sharedApplicationContext.sharedContext.accountManager, showCallsTab: callListSettings.showTab, reinitializedNotificationSettings: {
return AuthorizedApplicationContext(sharedApplicationContext: sharedApplicationContext, mainWindow: self.mainWindow, watchManagerArguments: watchManagerArgumentsPromise.get(), context: context, accountManager: sharedApplicationContext.sharedContext.accountManager, showCallsTab: callListSettings.showTab, reinitializedNotificationSettings: {
let _ = (self.context.get()
|> take(1)
|> deliverOnMainQueue).start(next: { context in
@ -932,7 +938,7 @@ private final class SharedApplicationContext {
}
return true
})
self.mainWindow.topLevelOverlayControllers = [sharedApplicationContext.overlayMediaController, context.notificationController]
self.mainWindow.topLevelOverlayControllers = [context.sharedApplicationContext.overlayMediaController, context.notificationController]
var authorizeNotifications = true
if #available(iOS 10.0, *) {
authorizeNotifications = false
@ -979,7 +985,10 @@ private final class SharedApplicationContext {
}))
self.watchCommunicationManagerPromise.set(watchCommunicationManager(context: self.context, allowBackgroundTimeExtension: { timeout in
wakeupManager.allowBackgroundTimeExtension(timeout: timeout)
let _ = (self.sharedContextPromise.get()
|> take(1)).start(next: { sharedContext in
sharedContext.wakeupManager.allowBackgroundTimeExtension(timeout: timeout)
})
}))
let _ = self.watchCommunicationManagerPromise.get().start(next: { manager in
if let manager = manager {
@ -1059,9 +1068,11 @@ private final class SharedApplicationContext {
}
}))
}
if let sharedContext = strongSelf.contextValue?.context.sharedContext {
let presentationData = sharedContext.currentPresentationData.with { $0 }
strongSelf.mainWindow.present(standardTextAlertController(theme: AlertControllerTheme(presentationTheme: presentationData.theme), title: alert.title, text: alert.message ?? "", actions: actions), on: .root)
}
}
})
BITHockeyBaseManager.setPresentView({ [weak self] controller in

View File

@ -46,6 +46,7 @@ private struct PasscodeState: Equatable {
}
final class AuthorizedApplicationContext {
let sharedApplicationContext: SharedApplicationContext
let mainWindow: Window1
let lockedCoveringView: LockedWindowCoveringView
@ -99,7 +100,9 @@ final class AuthorizedApplicationContext {
private var showCallsTabDisposable: Disposable?
private var enablePostboxTransactionsDiposable: Disposable?
init(mainWindow: Window1, watchManagerArguments: Signal<WatchManagerArguments?, NoError>, context: AccountContext, accountManager: AccountManager, showCallsTab: Bool, reinitializedNotificationSettings: @escaping () -> Void) {
init(sharedApplicationContext: SharedApplicationContext, mainWindow: Window1, watchManagerArguments: Signal<WatchManagerArguments?, NoError>, context: AccountContext, accountManager: AccountManager, showCallsTab: Bool, reinitializedNotificationSettings: @escaping () -> Void) {
self.sharedApplicationContext = sharedApplicationContext
setupLegacyComponents(context: context)
let presentationData = context.sharedContext.currentPresentationData.with { $0 }

View File

@ -19,7 +19,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>5.5</string>
<string>5.5.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>

View File

@ -3926,8 +3926,9 @@ Unused sets are archived when you add more.";
"ChatList.DeleteSavedMessagesConfirmation" = "Are you sure you want to delete\nSaved Messages?";
"Undo.Undo" = "Undo";
"Undo.MessagesDeleted" = "Messages deleted";
"Undo.ChatDeleted" = "Chat deleted";
"Undo.ChatCleared" = "Chat cleared";
"Undo.ChatClearedForBothSides" = "Chat cleared for both sides";
"Undo.SecretChatDeleted" = "Secret Chat deleted";
"Undo.LeftChannel" = "Left channel";
"Undo.LeftGroup" = "Left group";
@ -4200,3 +4201,5 @@ Unused sets are archived when you add more.";
"Settings.CheckPhoneNumberText" = "Keep your number up to date to ensure you can always log in to Telegram. [Learn more]()";
"Settings.KeepPhoneNumber" = "Keep %@";
"Settings.ChangePhoneNumber" = "Change Number";
"Undo.ChatDeletedForBothSides" = "Chat deleted for both sides";

View File

@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>5.5</string>
<string>5.5.1</string>
<key>CFBundleVersion</key>
<string>${BUILD_NUMBER}</string>
<key>UISupportedInterfaceOrientations</key>

View File

@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>5.5</string>
<string>5.5.1</string>
<key>CFBundleVersion</key>
<string>${BUILD_NUMBER}</string>
<key>NSExtension</key>

View File

@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>5.5</string>
<string>5.5.1</string>
<key>CFBundleVersion</key>
<string>${BUILD_NUMBER}</string>
<key>NSExtension</key>

View File

@ -13,6 +13,7 @@ app_identifier_llc = [
base_app_identifier_llc + ".watchkitapp.watchkitextension",
base_app_identifier_llc + ".NotificationService"
]
signing_identity_llc = "iPhone Distribution: Digital Fortress LLC (C67CF9S4VU)"
lane :do_build_app do |options|
gym(
@ -31,7 +32,8 @@ lane :do_build_app do |options|
iCloudContainerEnvironment: "Production",
provisioningProfiles: options[:provisioningProfiles],
stripSwiftSymbols: true,
uploadBitcode: false
uploadBitcode: false,
signingCertificate: options[:signingCertificate]
}
)
end
@ -47,6 +49,7 @@ lane :build_for_appstore do |options|
export_method: "app-store",
build_number: commit_count_string,
commit_id: commit[:commit_hash],
signingCertificate: signing_identity_llc,
provisioningProfiles: {
base_app_identifier_llc => "match AppStore " + base_app_identifier_llc,
base_app_identifier_llc + ".Share" => "match AppStore " + base_app_identifier_llc + ".Share",

@ -1 +1 @@
Subproject commit 5debb55eb0cd0154b866857476bdfb8122308664
Subproject commit eca5668fc9834be348e65edde3f4ec07eeffef0c

@ -1 +1 @@
Subproject commit eb72b51295e0b0b937d4c0af59adb4fdce4d67a7
Subproject commit fdcc098f8050834dd936f53a4476ac529abe6a58

@ -1 +1 @@
Subproject commit ae83518e5a5fc2b79a9425891ad33962c3066ff9
Subproject commit 44ccb031eb2ee52628e6f2710a178bdb4f3041b5