diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 4549157fb9..2e3328d7e6 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -18,7 +18,7 @@ internal:
except:
- tags
script:
- - PYTHONPATH="$PYTHONPATH:/darwin-containers" python3 -u build-system/Make/Make.py remote-build --darwinContainersHost="http://host.docker.internal:8650" --cacheHost="$TELEGRAM_BAZEL_CACHE_HOST" --configurationPath="/telegram-private-data/build-configurations/enterprise-configuration.json" --gitCodesigningRepository="$TELEGRAM_GIT_CODESIGNING_REPOSITORY" --gitCodesigningType=enterprise --configuration=release_arm64
+ - PYTHONPATH="$PYTHONPATH:/darwin-containers" python3 -u build-system/Make/Make.py remote-build --darwinContainersHost="http://host.docker.internal:8650" --cacheHost="$TELEGRAM_BAZEL_CACHE_HOST" --configurationPath="$TELEGRAM_PRIVATE_DATA_PATH/build-configurations/enterprise-configuration.json" --gitCodesigningRepository="$TELEGRAM_GIT_CODESIGNING_REPOSITORY" --gitCodesigningType=enterprise --configuration=release_arm64
- python3 -u build-system/Make/DeployToAppCenter.py --configuration="$TELEGRAM_PRIVATE_DATA_PATH/appcenter-configurations/appcenter-internal.json" --ipa="build/artifacts/Telegram.ipa" --dsyms="build/artifacts/Telegram.DSYMs.zip"
environment:
name: internal
@@ -92,7 +92,7 @@ beta_testflight:
except:
- tags
script:
- - PYTHONPATH="$PYTHONPATH:/darwin-containers" python3 -u build-system/Make/Make.py remote-build --darwinContainersHost="http://host.docker.internal:8650" --cacheHost="$TELEGRAM_BAZEL_CACHE_HOST" --configurationPath="build-system/appstore-configuration.json" --gitCodesigningRepository="$TELEGRAM_GIT_CODESIGNING_REPOSITORY" --gitCodesigningType=appstore --configuration=release_universal
+ - PYTHONPATH="$PYTHONPATH:/darwin-containers" python3 -u build-system/Make/Make.py remote-build --darwinContainersHost="http://host.docker.internal:8650" --cacheHost="$TELEGRAM_BAZEL_CACHE_HOST" --configurationPath="build-system/appstore-configuration.json" --gitCodesigningRepository="$TELEGRAM_GIT_CODESIGNING_REPOSITORY" --gitCodesigningType=appstore --configuration=release_arm64
environment:
name: testflight_llc
artifacts:
diff --git a/Telegram/BUILD b/Telegram/BUILD
index 953b177ea5..2469290bd5 100644
--- a/Telegram/BUILD
+++ b/Telegram/BUILD
@@ -115,6 +115,8 @@ genrule(
],
)
+minimum_os_version = "11.0"
+
empty_languages = [
"ar",
"be",
@@ -588,6 +590,18 @@ plist_fragment(
"""
)
+plist_fragment(
+ name = "RequiredDeviceCapabilitiesPlist",
+ extension = "plist",
+ template =
+ """
+ UIRequiredDeviceCapabilities
+
+ arm64
+
+ """
+)
+
plist_fragment(
name = "AppNameInfoPlist",
extension = "plist",
@@ -690,7 +704,7 @@ watchos_extension(
":AppNameInfoPlist",
":WatchExtensionNSExtensionInfoPlist",
],
- minimum_os_version = "5.0",
+ minimum_os_version = "9.0",
provisioning_profile = select({
":disableProvisioningProfilesSetting": None,
"//conditions:default": "@build_configuration//provisioning:WatchExtension.mobileprovision",
@@ -716,11 +730,11 @@ watchos_application(
infoplists = [
":WatchAppInfoPlist",
":VersionInfoPlist",
- "BuildNumberInfoPlist",
+ ":BuildNumberInfoPlist",
":AppNameInfoPlist",
":WatchAppCompanionInfoPlist",
],
- minimum_os_version = "5.0",
+ minimum_os_version = "9.0",
provisioning_profile = select({
":disableProvisioningProfilesSetting": None,
"//conditions:default": "@build_configuration//provisioning:WatchApp.mobileprovision",
@@ -767,8 +781,9 @@ ios_framework(
":MtProtoKitInfoPlist",
":BuildNumberInfoPlist",
":VersionInfoPlist",
+ ":RequiredDeviceCapabilitiesPlist",
],
- minimum_os_version = "9.0",
+ minimum_os_version = minimum_os_version,
extension_safe = True,
ipa_post_processor = strip_framework,
deps = [
@@ -807,8 +822,9 @@ ios_framework(
":SwiftSignalKitInfoPlist",
":BuildNumberInfoPlist",
":VersionInfoPlist",
+ ":RequiredDeviceCapabilitiesPlist",
],
- minimum_os_version = "9.0",
+ minimum_os_version = minimum_os_version,
extension_safe = True,
ipa_post_processor = strip_framework,
deps = [
@@ -847,11 +863,12 @@ ios_framework(
":PostboxInfoPlist",
":BuildNumberInfoPlist",
":VersionInfoPlist",
+ ":RequiredDeviceCapabilitiesPlist",
],
frameworks = [
":SwiftSignalKitFramework",
],
- minimum_os_version = "9.0",
+ minimum_os_version = minimum_os_version,
extension_safe = True,
ipa_post_processor = strip_framework,
deps = [
@@ -890,8 +907,9 @@ ios_framework(
":TelegramApiInfoPlist",
":BuildNumberInfoPlist",
":VersionInfoPlist",
+ ":RequiredDeviceCapabilitiesPlist",
],
- minimum_os_version = "9.0",
+ minimum_os_version = minimum_os_version,
extension_safe = True,
ipa_post_processor = strip_framework,
deps = [
@@ -930,13 +948,14 @@ ios_framework(
":TelegramCoreInfoPlist",
":BuildNumberInfoPlist",
":VersionInfoPlist",
+ ":RequiredDeviceCapabilitiesPlist",
],
frameworks = [
":MtProtoKitFramework",
":SwiftSignalKitFramework",
":PostboxFramework",
],
- minimum_os_version = "9.0",
+ minimum_os_version = minimum_os_version,
extension_safe = True,
ipa_post_processor = strip_framework,
deps = [
@@ -975,8 +994,9 @@ ios_framework(
":AsyncDisplayKitInfoPlist",
":BuildNumberInfoPlist",
":VersionInfoPlist",
+ ":RequiredDeviceCapabilitiesPlist",
],
- minimum_os_version = "9.0",
+ minimum_os_version = minimum_os_version,
extension_safe = True,
ipa_post_processor = strip_framework,
deps = [
@@ -1058,12 +1078,13 @@ ios_framework(
":DisplayInfoPlist",
":BuildNumberInfoPlist",
":VersionInfoPlist",
+ ":RequiredDeviceCapabilitiesPlist",
],
frameworks = [
":SwiftSignalKitFramework",
":AsyncDisplayKitFramework",
],
- minimum_os_version = "9.0",
+ minimum_os_version = minimum_os_version,
extension_safe = True,
ipa_post_processor = strip_framework,
deps = [
@@ -1102,6 +1123,7 @@ ios_framework(
":TelegramUIInfoPlist",
":BuildNumberInfoPlist",
":VersionInfoPlist",
+ ":RequiredDeviceCapabilitiesPlist",
],
frameworks = [
":MtProtoKitFramework",
@@ -1111,7 +1133,7 @@ ios_framework(
":AsyncDisplayKitFramework",
":DisplayFramework",
],
- minimum_os_version = "9.0",
+ minimum_os_version = minimum_os_version,
extension_safe = True,
ipa_post_processor = strip_framework,
deps = [
@@ -1195,10 +1217,11 @@ ios_extension(
infoplists = [
":ShareInfoPlist",
":VersionInfoPlist",
+ ":RequiredDeviceCapabilitiesPlist",
":BuildNumberInfoPlist",
":AppNameInfoPlist",
],
- minimum_os_version = "9.0",
+ minimum_os_version = minimum_os_version,
provisioning_profile = select({
":disableProvisioningProfilesSetting": None,
"//conditions:default": "@build_configuration//provisioning:Share.mobileprovision",
@@ -1269,7 +1292,7 @@ swift_library(
],
)
-genrule(
+'''genrule(
name = "SetMinOsVersionNotificationContentExtension",
cmd_bash =
"""
@@ -1286,7 +1309,7 @@ genrule(
visibility = [
"//visibility:public",
]
-)
+)'''
ios_extension(
name = "NotificationContentExtension",
@@ -1300,11 +1323,12 @@ ios_extension(
infoplists = [
":NotificationContentInfoPlist",
":VersionInfoPlist",
+ ":RequiredDeviceCapabilitiesPlist",
":BuildNumberInfoPlist",
":AppNameInfoPlist",
],
- minimum_os_version = "9.0", # maintain the same minimum OS version across extensions
- ipa_post_processor = ":SetMinOsVersionNotificationContentExtension",
+ minimum_os_version = minimum_os_version, # maintain the same minimum OS version across extensions
+ #ipa_post_processor = ":SetMinOsVersionNotificationContentExtension",
provisioning_profile = select({
":disableProvisioningProfilesSetting": None,
"//conditions:default": "@build_configuration//provisioning:NotificationContent.mobileprovision",
@@ -1404,10 +1428,11 @@ ios_extension(
infoplists = [
":WidgetInfoPlist",
":VersionInfoPlist",
+ ":RequiredDeviceCapabilitiesPlist",
":BuildNumberInfoPlist",
":AppNameInfoPlist",
],
- minimum_os_version = "9.0", # maintain the same minimum OS version across extensions
+ minimum_os_version = minimum_os_version, # maintain the same minimum OS version across extensions
ipa_post_processor = ":SetMinOsVersionWidgetExtension",
#provides_main = True,
provisioning_profile = select({
@@ -1506,7 +1531,7 @@ swift_library(
],
)
-genrule(
+'''genrule(
name = "SetMinOsVersionIntentsExtension",
cmd_bash =
"""
@@ -1523,7 +1548,7 @@ genrule(
visibility = [
"//visibility:public",
]
-)
+)'''
ios_extension(
name = "IntentsExtension",
@@ -1537,11 +1562,12 @@ ios_extension(
infoplists = [
":IntentsInfoPlist",
":VersionInfoPlist",
+ ":RequiredDeviceCapabilitiesPlist",
":BuildNumberInfoPlist",
":AppNameInfoPlist",
],
- minimum_os_version = "9.0", # maintain the same minimum OS version across extensions
- ipa_post_processor = ":SetMinOsVersionIntentsExtension",
+ minimum_os_version = minimum_os_version, # maintain the same minimum OS version across extensions
+ #ipa_post_processor = ":SetMinOsVersionIntentsExtension",
provisioning_profile = select({
":disableProvisioningProfilesSetting": None,
"//conditions:default": "@build_configuration//provisioning:Intents.mobileprovision",
@@ -1600,7 +1626,7 @@ swift_library(
],
)
-genrule(
+'''genrule(
name = "SetMinOsVersionBroadcastUploadExtension",
cmd_bash =
"""
@@ -1617,7 +1643,7 @@ genrule(
visibility = [
"//visibility:public",
]
-)
+)'''
ios_extension(
name = "BroadcastUploadExtension",
@@ -1631,11 +1657,12 @@ ios_extension(
infoplists = [
":BroadcastUploadInfoPlist",
":VersionInfoPlist",
+ ":RequiredDeviceCapabilitiesPlist",
":BuildNumberInfoPlist",
":AppNameInfoPlist",
],
- minimum_os_version = "9.0", # maintain the same minimum OS version across extensions
- ipa_post_processor = ":SetMinOsVersionBroadcastUploadExtension",
+ minimum_os_version = minimum_os_version, # maintain the same minimum OS version across extensions
+ #ipa_post_processor = ":SetMinOsVersionBroadcastUploadExtension",
provisioning_profile = select({
":disableProvisioningProfilesSetting": None,
"//conditions:default": "@build_configuration//provisioning:BroadcastUpload.mobileprovision",
@@ -1679,7 +1706,7 @@ plist_fragment(
)
)
-genrule(
+'''genrule(
name = "SetMinOsVersionNotificationServiceExtension",
cmd_bash =
"""
@@ -1696,7 +1723,7 @@ genrule(
visibility = [
"//visibility:public",
]
-)
+)'''
ios_extension(
name = "NotificationServiceExtension",
@@ -1710,11 +1737,12 @@ ios_extension(
infoplists = [
":NotificationServiceInfoPlist",
":VersionInfoPlist",
+ ":RequiredDeviceCapabilitiesPlist",
":BuildNumberInfoPlist",
":AppNameInfoPlist",
],
- minimum_os_version = "9.0", # maintain the same minimum OS version across extensions
- ipa_post_processor = ":SetMinOsVersionNotificationServiceExtension",
+ minimum_os_version = minimum_os_version, # maintain the same minimum OS version across extensions
+ #ipa_post_processor = ":SetMinOsVersionNotificationServiceExtension",
provisioning_profile = select({
":disableProvisioningProfilesSetting": None,
"//conditions:default": "@build_configuration//provisioning:NotificationService.mobileprovision",
@@ -1846,10 +1874,6 @@ plist_fragment(
UILaunchStoryboardName
LaunchScreen
- UIRequiredDeviceCapabilities
-
- armv7
-
UIRequiresPersistentWiFi
UIStatusBarStyle
@@ -1912,7 +1936,7 @@ ios_application(
telegram_bundle_id = telegram_bundle_id,
),
families = ["iphone", "ipad"],
- minimum_os_version = "9.0",
+ minimum_os_version = minimum_os_version,
provisioning_profile = select({
":disableProvisioningProfilesSetting": None,
"//conditions:default": "@build_configuration//provisioning:Telegram.mobileprovision",
@@ -1922,6 +1946,7 @@ ios_application(
":TelegramInfoPlist",
":BuildNumberInfoPlist",
":VersionInfoPlist",
+ ":RequiredDeviceCapabilitiesPlist",
":UrlTypesInfoPlist",
],
alternate_icons = [
@@ -1958,7 +1983,7 @@ ios_application(
}),
watch_application = select({
":disableExtensionsSetting": None,
- "//conditions:default": None,#":TelegramWatchApp",
+ "//conditions:default": ":TelegramWatchApp",
}) if telegram_enable_watch else None,
deps = [
":Main",
@@ -1974,7 +1999,7 @@ ios_application(
telegram_bundle_id = telegram_bundle_id,
),
families = ["iphone", "ipad"],
- minimum_os_version = "9.0",
+ minimum_os_version = minimum_os_version,
provisioning_profile = select({
":disableProvisioningProfilesSetting": None,
"//conditions:default": "@build_configuration//provisioning:Telegram.mobileprovision",
@@ -1984,6 +2009,7 @@ ios_application(
":TelegramInfoPlist",
":BuildNumberInfoPlist",
":VersionInfoPlist",
+ ":RequiredDeviceCapabilitiesPlist",
":UrlTypesInfoPlist",
],
deps = [
@@ -1997,7 +2023,7 @@ ios_application(
telegram_bundle_id = telegram_bundle_id,
),
families = ["iphone", "ipad"],
- minimum_os_version = "9.0",
+ minimum_os_version = minimum_os_version,
provisioning_profile = select({
":disableProvisioningProfilesSetting": None,
"//conditions:default": "@build_configuration//provisioning:Telegram.mobileprovision",
@@ -2007,6 +2033,7 @@ ios_application(
":TelegramInfoPlist",
":BuildNumberInfoPlist",
":VersionInfoPlist",
+ ":RequiredDeviceCapabilitiesPlist",
":UrlTypesInfoPlist",
],
deps = [
diff --git a/Telegram/NotificationService/Sources/NotificationService.swift b/Telegram/NotificationService/Sources/NotificationService.swift
index 44bba89c8b..61dca23a25 100644
--- a/Telegram/NotificationService/Sources/NotificationService.swift
+++ b/Telegram/NotificationService/Sources/NotificationService.swift
@@ -642,7 +642,7 @@ private final class NotificationServiceHandler {
let logsPath = rootPath + "/logs/notification-logs"
let _ = try? FileManager.default.createDirectory(atPath: logsPath, withIntermediateDirectories: true, attributes: nil)
- setupSharedLogger(rootPath: rootPath, path: logsPath)
+ setupSharedLogger(rootPath: logsPath, path: logsPath)
initializeAccountManagement()
@@ -652,6 +652,24 @@ private final class NotificationServiceHandler {
let deviceSpecificEncryptionParameters = BuildConfig.deviceSpecificEncryptionParameters(rootPath, baseAppBundleId: baseAppBundleId)
self.encryptionParameters = ValueBoxEncryptionParameters(forceEncryptionIfNoSet: false, key: ValueBoxEncryptionParameters.Key(data: deviceSpecificEncryptionParameters.key)!, salt: ValueBoxEncryptionParameters.Salt(data: deviceSpecificEncryptionParameters.salt)!)
+
+ let semaphore = DispatchSemaphore(value: 0)
+ var loggingSettings = LoggingSettings.defaultSettings
+ let _ = (self.accountManager.transaction { transaction -> LoggingSettings in
+ if let value = transaction.getSharedData(SharedDataKeys.loggingSettings)?.get(LoggingSettings.self) {
+ return value
+ } else {
+ return LoggingSettings.defaultSettings
+ }
+ }).start(next: { value in
+ loggingSettings = value
+ semaphore.signal()
+ })
+ semaphore.wait()
+
+ Logger.shared.logToFile = loggingSettings.logToFile
+ Logger.shared.logToConsole = loggingSettings.logToConsole
+ Logger.shared.redactSensitiveData = loggingSettings.redactSensitiveData
let networkArguments = NetworkInitializationArguments(apiId: apiId, apiHash: apiHash, languagesCategory: languagesCategory, appVersion: appVersion, voipMaxLayer: 0, voipVersions: [], appData: .single(buildConfig.bundleData(withAppToken: nil, signatureDict: nil)), autolockDeadine: .single(nil), encryptionProvider: OpenSSLEncryptionProvider(), resolvedDeviceName: nil)
diff --git a/Telegram/SiriIntents/IntentHandler.swift b/Telegram/SiriIntents/IntentHandler.swift
index 2bbebcf1d5..5c718a5324 100644
--- a/Telegram/SiriIntents/IntentHandler.swift
+++ b/Telegram/SiriIntents/IntentHandler.swift
@@ -116,7 +116,7 @@ class DefaultIntentHandler: INExtension, INSendMessageIntentHandling, INSearchFo
let logsPath = rootPath + "/logs/siri-logs"
let _ = try? FileManager.default.createDirectory(atPath: logsPath, withIntermediateDirectories: true, attributes: nil)
- setupSharedLogger(rootPath: rootPath, path: logsPath)
+ setupSharedLogger(rootPath: logsPath, path: logsPath)
let appVersion = (Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String) ?? "unknown"
diff --git a/Telegram/WidgetKitWidget/TodayViewController.swift b/Telegram/WidgetKitWidget/TodayViewController.swift
index 6a852b13ff..3b40feb3e0 100644
--- a/Telegram/WidgetKitWidget/TodayViewController.swift
+++ b/Telegram/WidgetKitWidget/TodayViewController.swift
@@ -94,7 +94,7 @@ private func getCommonTimeline(friends: [Friend]?, in context: TimelineProviderC
let logsPath = rootPath + "/logs/widget-logs"
let _ = try? FileManager.default.createDirectory(atPath: logsPath, withIntermediateDirectories: true, attributes: nil)
- setupSharedLogger(rootPath: rootPath, path: logsPath)
+ setupSharedLogger(rootPath: logsPath, path: logsPath)
initializeAccountManagement()
diff --git a/build-system/Make/Make.py b/build-system/Make/Make.py
index c1b8b7ecc0..d07e1932d6 100644
--- a/build-system/Make/Make.py
+++ b/build-system/Make/Make.py
@@ -59,6 +59,9 @@ class BazelCommandLine:
# https://docs.bazel.build/versions/master/command-line-reference.html
# Print the subcommand details in case of failure.
'--verbose_failures',
+
+ # Asynchronously upload cache artifacts
+ '--experimental_remote_cache_async',
]
self.common_build_args = [
@@ -144,7 +147,7 @@ class BazelCommandLine:
'--ios_multi_cpus=armv7,arm64',
# Always build universal Watch binaries.
- '--watchos_cpus=armv7k,arm64_32'
+ '--watchos_cpus=arm64_32'
] + self.common_debug_args
elif configuration == 'debug_arm64':
self.configuration_args = [
@@ -155,7 +158,7 @@ class BazelCommandLine:
'--ios_multi_cpus=arm64',
# Always build universal Watch binaries.
- '--watchos_cpus=armv7k,arm64_32'
+ '--watchos_cpus=arm64_32'
] + self.common_debug_args
elif configuration == 'debug_sim_arm64':
self.configuration_args = [
@@ -166,7 +169,7 @@ class BazelCommandLine:
'--ios_multi_cpus=sim_arm64',
# Always build universal Watch binaries.
- '--watchos_cpus=armv7k,arm64_32'
+ '--watchos_cpus=arm64_32'
] + self.common_debug_args
elif configuration == 'debug_armv7':
self.configuration_args = [
@@ -176,7 +179,7 @@ class BazelCommandLine:
'--ios_multi_cpus=armv7',
# Always build universal Watch binaries.
- '--watchos_cpus=armv7k,arm64_32'
+ '--watchos_cpus=arm64_32'
] + self.common_debug_args
elif configuration == 'release_arm64':
self.configuration_args = [
@@ -187,7 +190,7 @@ class BazelCommandLine:
'--ios_multi_cpus=arm64',
# Always build universal Watch binaries.
- '--watchos_cpus=armv7k,arm64_32',
+ '--watchos_cpus=arm64_32',
# Generate DSYM files when building.
'--apple_generate_dsym',
@@ -204,7 +207,7 @@ class BazelCommandLine:
'--ios_multi_cpus=armv7',
# Always build universal Watch binaries.
- '--watchos_cpus=armv7k,arm64_32',
+ '--watchos_cpus=arm64_32',
# Generate DSYM files when building.
'--apple_generate_dsym',
@@ -221,7 +224,7 @@ class BazelCommandLine:
'--ios_multi_cpus=armv7,arm64',
# Always build universal Watch binaries.
- '--watchos_cpus=armv7k,arm64_32',
+ '--watchos_cpus=arm64_32',
# Generate DSYM files when building.
'--apple_generate_dsym',
@@ -411,7 +414,7 @@ def resolve_codesigning(arguments, base_path, build_configuration, provisioning_
bundle_id=build_configuration.bundle_id,
codesigning_type=arguments.gitCodesigningType,
password=password,
- always_fetch=arguments.gitCodesigningAlwaysFetch
+ always_fetch=not arguments.gitCodesigningUseCurrent
)
elif arguments.codesigningInformationPath is not None:
profile_source = DirectoryCodesigningSource(
@@ -666,10 +669,10 @@ def add_codesigning_common_arguments(current_parser: argparse.ArgumentParser):
)
current_parser.add_argument(
- '--gitCodesigningAlwaysFetch',
+ '--gitCodesigningUseCurrent',
action='store_true',
required=False,
- default=True,
+ default=False,
help='''
Always refresh codesigning repository.
'''
diff --git a/submodules/AccountContext/Sources/DeviceContactData.swift b/submodules/AccountContext/Sources/DeviceContactData.swift
index fe5aca7de9..3a230a184f 100644
--- a/submodules/AccountContext/Sources/DeviceContactData.swift
+++ b/submodules/AccountContext/Sources/DeviceContactData.swift
@@ -478,8 +478,28 @@ public extension DeviceContactExtendedData {
}
}
-extension DeviceContactAddressData {
- public var dictionary: [String: String] {
+public extension DeviceContactAddressData {
+ var asPostalAddress: CNPostalAddress {
+ let address = CNMutablePostalAddress()
+ if !self.street1.isEmpty {
+ address.street = self.street1
+ }
+ if !self.city.isEmpty {
+ address.city = self.city
+ }
+ if !self.state.isEmpty {
+ address.state = self.state
+ }
+ if !self.country.isEmpty {
+ address.country = self.country
+ }
+ if !self.postcode.isEmpty {
+ address.postalCode = self.postcode
+ }
+ return address
+ }
+
+ var dictionary: [String: String] {
var dictionary: [String: String] = [:]
if !self.street1.isEmpty {
dictionary["Street"] = self.street1
@@ -499,7 +519,7 @@ extension DeviceContactAddressData {
return dictionary
}
- public var string: String {
+ var string: String {
var array: [String] = []
if !self.street1.isEmpty {
array.append(self.street1)
@@ -519,7 +539,7 @@ extension DeviceContactAddressData {
return array.joined(separator: " ")
}
- public var displayString: String {
+ var displayString: String {
var array: [String] = []
if !self.street1.isEmpty {
array.append(self.street1)
diff --git a/submodules/Camera/Sources/CameraDevice.swift b/submodules/Camera/Sources/CameraDevice.swift
index 5cbf8ff7e1..58d048818c 100644
--- a/submodules/Camera/Sources/CameraDevice.swift
+++ b/submodules/Camera/Sources/CameraDevice.swift
@@ -17,7 +17,7 @@ final class CameraDevice {
func configure(for session: AVCaptureSession, position: Camera.Position) {
self.position = position
if #available(iOSApplicationExtension 10.0, iOS 10.0, *) {
- self.videoDevice = AVCaptureDevice.DiscoverySession(deviceTypes: [.builtInDuoCamera, .builtInWideAngleCamera, .builtInTelephotoCamera], mediaType: .video, position: position).devices.first
+ self.videoDevice = AVCaptureDevice.DiscoverySession(deviceTypes: [.builtInDualCamera, .builtInWideAngleCamera, .builtInTelephotoCamera], mediaType: .video, position: position).devices.first
} else {
self.videoDevice = AVCaptureDevice.devices(for: .video).filter { $0.position == position }.first
}
@@ -61,7 +61,7 @@ final class CameraDevice {
}
}
- var isFlashActive: Signal {
+ /*var isFlashActive: Signal {
return self.videoDevicePromise.get()
|> mapToSignal { device -> Signal in
return Signal { subscriber in
@@ -75,7 +75,7 @@ final class CameraDevice {
}
|> distinctUntilChanged
}
- }
+ }*/
var isFlashAvailable: Signal {
return self.videoDevicePromise.get()
diff --git a/submodules/ChatListUI/Sources/ChatListController.swift b/submodules/ChatListUI/Sources/ChatListController.swift
index 04d03267f8..a8b602ebbe 100644
--- a/submodules/ChatListUI/Sources/ChatListController.swift
+++ b/submodules/ChatListUI/Sources/ChatListController.swift
@@ -853,8 +853,10 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController
self.emojiStatusSelectionController?.dismiss()
var selectedItems = Set()
var topStatusTitle = self.presentationData.strings.PeerStatusSetup_NoTimerTitle
+ var currentSelection: Int64?
if let peerStatus = self.titleView.title.peerStatus, case let .emoji(emojiStatus) = peerStatus {
selectedItems.insert(MediaId(namespace: Namespaces.Media.CloudFile, id: emojiStatus.fileId))
+ currentSelection = emojiStatus.fileId
if let timestamp = emojiStatus.expirationDate {
topStatusTitle = peerStatusExpirationString(statusTimestamp: timestamp, relativeTo: Int32(Date().timeIntervalSince1970), strings: self.presentationData.strings, dateTimeFormat: self.presentationData.dateTimeFormat)
@@ -878,6 +880,7 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController
selectedItems: selectedItems,
topStatusTitle: topStatusTitle
),
+ currentSelection: currentSelection,
destinationItemView: { [weak sourceView] in
return sourceView
}
diff --git a/submodules/Components/ReactionListContextMenuContent/BUILD b/submodules/Components/ReactionListContextMenuContent/BUILD
index cd2e7552c1..08714ce9a7 100644
--- a/submodules/Components/ReactionListContextMenuContent/BUILD
+++ b/submodules/Components/ReactionListContextMenuContent/BUILD
@@ -25,6 +25,7 @@ swift_library(
"//submodules/TelegramUI/Components/AnimationCache:AnimationCache",
"//submodules/TelegramUI/Components/MultiAnimationRenderer:MultiAnimationRenderer",
"//submodules/TelegramUI/Components/EmojiTextAttachmentView:EmojiTextAttachmentView",
+ "//submodules/TelegramUI/Components/EmojiStatusComponent:EmojiStatusComponent",
"//submodules/TextFormat:TextFormat",
],
visibility = [
diff --git a/submodules/Components/ReactionListContextMenuContent/Sources/ReactionListContextMenuContent.swift b/submodules/Components/ReactionListContextMenuContent/Sources/ReactionListContextMenuContent.swift
index 30e2b99e87..f27503f8ad 100644
--- a/submodules/Components/ReactionListContextMenuContent/Sources/ReactionListContextMenuContent.swift
+++ b/submodules/Components/ReactionListContextMenuContent/Sources/ReactionListContextMenuContent.swift
@@ -16,6 +16,7 @@ import AnimationCache
import MultiAnimationRenderer
import EmojiTextAttachmentView
import TextFormat
+import EmojiStatusComponent
private let avatarFont = avatarPlaceholderFont(size: 16.0)
@@ -357,7 +358,7 @@ public final class ReactionListContextMenuContent: ContextControllerItemsContent
let highlightBackgroundNode: ASDisplayNode
let avatarNode: AvatarNode
let titleLabelNode: ImmediateTextNode
- var credibilityIconNode: ASImageNode?
+ var credibilityIconView: ComponentView?
let separatorNode: ASDisplayNode
private var reactionLayer: InlineStickerItemLayer?
@@ -519,20 +520,46 @@ public final class ReactionListContextMenuContent: ContextControllerItemsContent
}
let premiumConfiguration = PremiumConfiguration.with(appConfiguration: self.context.currentAppConfiguration.with { $0 })
- var currentCredibilityIconImage: UIImage?
+ var currentCredibilityIcon: EmojiStatusComponent.Content?
if item.peer.isScam {
- currentCredibilityIconImage = PresentationResourcesChatList.scamIcon(presentationData.theme, strings: presentationData.strings, type: .regular)
+ currentCredibilityIcon = .text(color: presentationData.theme.chat.message.incoming.scamColor, string: presentationData.strings.Message_ScamAccount.uppercased())
} else if item.peer.isFake {
- currentCredibilityIconImage = PresentationResourcesChatList.fakeIcon(presentationData.theme, strings: presentationData.strings, type: .regular)
+ currentCredibilityIcon = .text(color: presentationData.theme.chat.message.incoming.scamColor, string: presentationData.strings.Message_FakeAccount.uppercased())
+ } else if case let .user(user) = item.peer, let emojiStatus = user.emojiStatus {
+ currentCredibilityIcon = .animation(content: .customEmoji(fileId: emojiStatus.fileId), size: CGSize(width: 32.0, height: 32.0), placeholderColor: UIColor(white: 0.0, alpha: 0.1), themeColor: presentationData.theme.list.itemAccentColor, loopMode: .count(2))
} else if item.peer.isVerified {
- currentCredibilityIconImage = PresentationResourcesChatList.verifiedIcon(presentationData.theme)
+ currentCredibilityIcon = .verified(fillColor: presentationData.theme.list.itemCheckColors.fillColor, foregroundColor: presentationData.theme.list.itemCheckColors.foregroundColor, sizeType: .compact)
} else if item.peer.isPremium && !premiumConfiguration.isPremiumDisabled {
- currentCredibilityIconImage = PresentationResourcesChatList.premiumIcon(presentationData.theme)
+ currentCredibilityIcon = .premium(color: presentationData.theme.list.itemCheckColors.fillColor)
+ }
+
+ var credibilityIconSize: CGSize?
+ if let currentCredibilityIcon = currentCredibilityIcon {
+ let credibilityIconView: ComponentView
+ if let current = self.credibilityIconView {
+ credibilityIconView = current
+ } else {
+ credibilityIconView = ComponentView()
+ self.credibilityIconView = credibilityIconView
+ }
+ credibilityIconSize = credibilityIconView.update(
+ transition: .immediate,
+ component: AnyComponent(EmojiStatusComponent(
+ context: self.context,
+ animationCache: self.context.animationCache,
+ animationRenderer: self.context.animationRenderer,
+ content: currentCredibilityIcon,
+ isVisibleForAnimations: true,
+ action: nil
+ )),
+ environment: {},
+ containerSize: CGSize(width: 24.0, height: 24.0)
+ )
}
var additionalTitleInset: CGFloat = 0.0
- if let currentCredibilityIconImage = currentCredibilityIconImage {
- additionalTitleInset += 3.0 + currentCredibilityIconImage.size.width
+ if let credibilityIconSize = credibilityIconSize {
+ additionalTitleInset += 3.0 + credibilityIconSize.width
}
self.highlightBackgroundNode.backgroundColor = presentationData.theme.contextMenu.itemHighlightedBackgroundColor
@@ -552,23 +579,16 @@ public final class ReactionListContextMenuContent: ContextControllerItemsContent
let titleFrame = CGRect(origin: CGPoint(x: avatarInset + avatarSize + avatarSpacing, y: floor((size.height - titleSize.height) / 2.0)), size: titleSize)
self.titleLabelNode.frame = titleFrame
- if let currentCredibilityIconImage = currentCredibilityIconImage {
- let iconNode: ASImageNode
- if let current = self.credibilityIconNode {
- iconNode = current
- } else {
- iconNode = ASImageNode()
- iconNode.isLayerBacked = true
- iconNode.displaysAsynchronously = false
- iconNode.displayWithoutProcessing = true
- self.addSubnode(iconNode)
- self.credibilityIconNode = iconNode
+ if let credibilityIconView = self.credibilityIconView, let credibilityIconSize = credibilityIconSize {
+ if let credibilityIconComponentView = credibilityIconView.view {
+ if credibilityIconComponentView.superview == nil {
+ self.view.addSubview(credibilityIconComponentView)
+ }
+ credibilityIconComponentView.frame = CGRect(origin: CGPoint(x: titleFrame.maxX + 4.0, y: floorToScreenPixels(titleFrame.midY - credibilityIconSize.height / 2.0) + 1.0 - UIScreenPixel), size: credibilityIconSize)
}
- iconNode.image = currentCredibilityIconImage
- iconNode.frame = CGRect(origin: CGPoint(x: titleFrame.maxX + 4.0, y: floorToScreenPixels(titleFrame.midY - currentCredibilityIconImage.size.height / 2.0) + 1.0 - UIScreenPixel), size: currentCredibilityIconImage.size)
- } else if let credibilityIconNode = self.credibilityIconNode {
- self.credibilityIconNode = nil
- credibilityIconNode.removeFromSupernode()
+ } else if let credibilityIconView = self.credibilityIconView {
+ self.credibilityIconView = nil
+ credibilityIconView.view?.removeFromSuperview()
}
let reactionSize = CGSize(width: 22.0, height: 22.0)
diff --git a/submodules/ContextUI/Sources/ContextController.swift b/submodules/ContextUI/Sources/ContextController.swift
index a3f5f4860c..380fe516d6 100644
--- a/submodules/ContextUI/Sources/ContextController.swift
+++ b/submodules/ContextUI/Sources/ContextController.swift
@@ -232,8 +232,6 @@ private final class ContextControllerNode: ViewControllerTracingNode, UIScrollVi
private var customPosition: CGPoint?
private let contentContainerNode: ContextContentContainerNode
private var actionsContainerNode: ContextActionsContainerNode
- private var reactionContextNode: ReactionContextNode?
- private var reactionContextNodeIsAnimatingOut = false
private var didCompleteAnimationIn = false
private var initialContinueGesturePoint: CGPoint?
@@ -401,15 +399,6 @@ private final class ContextControllerNode: ViewControllerTracingNode, UIScrollVi
strongSelf.hapticFeedback.tap()
}
}
-
- if let reactionContextNode = strongSelf.reactionContextNode {
- let reactionPoint = strongSelf.view.convert(localPoint, to: reactionContextNode.view)
- let highlightedReaction = reactionContextNode.reaction(at: reactionPoint)?.reaction
- if strongSelf.highlightedReaction?.rawValue != highlightedReaction?.rawValue {
- strongSelf.highlightedReaction = highlightedReaction
- strongSelf.hapticFeedback.tap()
- }
- }
}
}
}
@@ -428,9 +417,6 @@ private final class ContextControllerNode: ViewControllerTracingNode, UIScrollVi
strongSelf.highlightedActionNode = nil
highlightedActionNode.performAction()
}
- if let highlightedReaction = strongSelf.highlightedReaction {
- strongSelf.reactionContextNode?.performReactionSelection(reaction: highlightedReaction, isLarge: false)
- }
} else {
if let highlightedActionNode = strongSelf.highlightedActionNode {
strongSelf.highlightedActionNode = nil
@@ -479,15 +465,6 @@ private final class ContextControllerNode: ViewControllerTracingNode, UIScrollVi
strongSelf.hapticFeedback.tap()
}
}
-
- if let reactionContextNode = strongSelf.reactionContextNode {
- let reactionPoint = strongSelf.view.convert(localPoint, to: reactionContextNode.view)
- let highlightedReaction = reactionContextNode.reaction(at: reactionPoint)?.reaction
- if strongSelf.highlightedReaction?.rawValue != highlightedReaction?.rawValue {
- strongSelf.highlightedReaction = highlightedReaction
- strongSelf.hapticFeedback.tap()
- }
- }
}
}
}
@@ -506,10 +483,6 @@ private final class ContextControllerNode: ViewControllerTracingNode, UIScrollVi
strongSelf.highlightedActionNode = nil
highlightedActionNode.performAction()
}
-
- if let highlightedReaction = strongSelf.highlightedReaction {
- strongSelf.reactionContextNode?.performReactionSelection(reaction: highlightedReaction, isLarge: false)
- }
} else {
if let highlightedActionNode = strongSelf.highlightedActionNode {
strongSelf.highlightedActionNode = nil
@@ -593,15 +566,6 @@ private final class ContextControllerNode: ViewControllerTracingNode, UIScrollVi
actionNode.setIsHighlighted(true)
}
}
-
- if let reactionContextNode = self.reactionContextNode {
- let reactionPoint = self.view.convert(localPoint, to: reactionContextNode.view)
- let highlightedReaction = reactionContextNode.reaction(at: reactionPoint)?.reaction
- if self.highlightedReaction?.rawValue != highlightedReaction?.rawValue {
- self.highlightedReaction = highlightedReaction
- self.hapticFeedback.tap()
- }
- }
}
case .ended, .cancelled:
if let presentationNode = self.presentationNode {
@@ -611,10 +575,6 @@ private final class ContextControllerNode: ViewControllerTracingNode, UIScrollVi
self.highlightedActionNode = nil
highlightedActionNode.setIsHighlighted(false)
}
-
- if let _ = self.reactionContextNode {
- self.highlightedReaction = nil
- }
}
default:
break
@@ -949,10 +909,6 @@ private final class ContextControllerNode: ViewControllerTracingNode, UIScrollVi
localContentSourceFrame = localSourceFrame
}
- if let reactionContextNode = self.reactionContextNode {
- reactionContextNode.animateIn(from: CGRect(origin: CGPoint(x: originalProjectedContentViewFrame.1.minX, y: originalProjectedContentViewFrame.1.minY), size: contentParentNode.contentRect.size))
- }
-
self.actionsContainerNode.layer.animateSpring(from: NSValue(cgPoint: CGPoint(x: localSourceFrame.center.x - self.actionsContainerNode.position.x, y: localSourceFrame.center.y - self.actionsContainerNode.position.y + actionsOffset)), to: NSValue(cgPoint: CGPoint()), keyPath: "position", duration: actionsDuration, initialVelocity: 0.0, damping: springDamping, additive: true)
let contentContainerOffset = CGPoint(x: localContentSourceFrame.center.x - self.contentContainerNode.frame.center.x - contentParentNode.contentRect.minX, y: localContentSourceFrame.center.y - self.contentContainerNode.frame.center.y - contentParentNode.contentRect.minY)
self.contentContainerNode.layer.animateSpring(from: NSValue(cgPoint: contentContainerOffset), to: NSValue(cgPoint: CGPoint()), keyPath: "position", duration: contentDuration, initialVelocity: 0.0, damping: springDamping, additive: true, completion: { [weak self] _ in
@@ -1286,10 +1242,6 @@ private final class ContextControllerNode: ViewControllerTracingNode, UIScrollVi
contentParentNode.updateAbsoluteRect?(self.contentContainerNode.frame.offsetBy(dx: 0.0, dy: -self.scrollNode.view.contentOffset.y + contentContainerOffset.y), self.bounds.size)
contentParentNode.applyAbsoluteOffset?(CGPoint(x: 0.0, y: -contentContainerOffset.y), transitionCurve, transitionDuration)
- if let reactionContextNode = self.reactionContextNode {
- reactionContextNode.animateOut(to: CGRect(origin: CGPoint(x: originalProjectedContentViewFrame.1.minX, y: originalProjectedContentViewFrame.1.minY), size: contentParentNode.contentRect.size), animatingOutToReaction: self.reactionContextNodeIsAnimatingOut)
- }
-
contentParentNode.willUpdateIsExtractedToContextPreview?(false, .animated(duration: 0.2, curve: .easeInOut))
} else {
if let snapshotView = contentParentNode.contentNode.view.snapshotContentTree(keepTransform: true) {
@@ -1308,10 +1260,6 @@ private final class ContextControllerNode: ViewControllerTracingNode, UIScrollVi
contentParentNode.contentNode.layer.animateAlpha(from: 0.0, to: 1.0, duration: 0.2)
contentParentNode.willUpdateIsExtractedToContextPreview?(false, .animated(duration: 0.2, curve: .easeInOut))
-
- if let reactionContextNode = self.reactionContextNode {
- reactionContextNode.animateOut(to: nil, animatingOutToReaction: self.reactionContextNodeIsAnimatingOut)
- }
}
case let .controller(source):
guard let maybeContentNode = self.contentContainerNode.contentNode, case let .controller(controller) = maybeContentNode else {
@@ -1449,10 +1397,6 @@ private final class ContextControllerNode: ViewControllerTracingNode, UIScrollVi
completedContentNode = true
intermediateCompletion()
})
-
- if let reactionContextNode = self.reactionContextNode {
- reactionContextNode.animateOut(to: nil, animatingOutToReaction: self.reactionContextNodeIsAnimatingOut)
- }
}
}
}
@@ -1461,10 +1405,6 @@ private final class ContextControllerNode: ViewControllerTracingNode, UIScrollVi
if let presentationNode = self.presentationNode {
presentationNode.addRelativeContentOffset(offset, transition: transition)
}
- if self.reactionContextNodeIsAnimatingOut, let reactionContextNode = self.reactionContextNode {
- reactionContextNode.bounds = reactionContextNode.bounds.offsetBy(dx: 0.0, dy: offset.y)
- transition.animateOffsetAdditive(node: reactionContextNode, offset: -offset.y)
- }
}
func cancelReactionAnimation() {
@@ -1520,13 +1460,6 @@ private final class ContextControllerNode: ViewControllerTracingNode, UIScrollVi
self.currentItems = items
self.currentActionsMinHeight = minHeight
-
- if let reactionContextNode = self.reactionContextNode {
- self.reactionContextNode = nil
- reactionContextNode.layer.animateAlpha(from: 1.0, to: 0.0, duration: 0.2, removeOnCompletion: false, completion: { [weak reactionContextNode] _ in
- reactionContextNode?.removeFromSupernode()
- })
- }
let previousActionsContainerNode = self.actionsContainerNode
let previousActionsContainerFrame = previousActionsContainerNode.view.convert(previousActionsContainerNode.bounds, to: self.view)
@@ -1648,11 +1581,7 @@ private final class ContextControllerNode: ViewControllerTracingNode, UIScrollVi
transition.updateFrame(node: self.scrollNode, frame: CGRect(origin: CGPoint(), size: layout.size))
let actionsSideInset: CGFloat = layout.safeInsets.left + 12.0
- var contentTopInset: CGFloat = max(11.0, layout.statusBarHeight ?? 0.0)
-
- if let _ = self.reactionContextNode {
- contentTopInset += 34.0
- }
+ let contentTopInset: CGFloat = max(11.0, layout.statusBarHeight ?? 0.0)
let actionsBottomInset: CGFloat = 11.0
@@ -1897,12 +1826,6 @@ private final class ContextControllerNode: ViewControllerTracingNode, UIScrollVi
let absoluteContentRect = contentContainerFrame.offsetBy(dx: 0.0, dy: -self.scrollNode.view.contentOffset.y)
contentParentNode.updateAbsoluteRect?(absoluteContentRect, layout.size)
-
- if let reactionContextNode = self.reactionContextNode {
- let insets = layout.insets(options: [.statusBar])
- transition.updateFrame(node: reactionContextNode, frame: CGRect(origin: CGPoint(), size: layout.size))
- reactionContextNode.updateLayout(size: layout.size, insets: insets, anchorRect: CGRect(origin: CGPoint(x: absoluteContentRect.minX + contentParentNode.contentRect.minX, y: absoluteContentRect.minY + contentParentNode.contentRect.minY), size: contentParentNode.contentRect.size), isAnimatingOut: false, transition: transition)
- }
}
case let .controller(contentParentNode):
var projectedFrame: CGRect = convertFrame(contentParentNode.sourceView.bounds, from: contentParentNode.sourceView, to: self.view)
@@ -2033,14 +1956,6 @@ private final class ContextControllerNode: ViewControllerTracingNode, UIScrollVi
transition.animateOffsetAdditive(node: self.scrollNode, offset: currentContainerFrame.minY - previousContainerFrame.minY)
}
}
-
- let absoluteContentRect = contentContainerFrame.offsetBy(dx: 0.0, dy: -self.scrollNode.view.contentOffset.y)
-
- if let reactionContextNode = self.reactionContextNode {
- let insets = layout.insets(options: [.statusBar])
- transition.updateFrame(node: reactionContextNode, frame: CGRect(origin: CGPoint(), size: layout.size))
- reactionContextNode.updateLayout(size: layout.size, insets: insets, anchorRect: CGRect(origin: CGPoint(x: absoluteContentRect.minX, y: absoluteContentRect.minY), size: contentSize), isAnimatingOut: false, transition: transition)
- }
}
}
}
@@ -2149,12 +2064,6 @@ private final class ContextControllerNode: ViewControllerTracingNode, UIScrollVi
return presentationNode.hitTest(self.view.convert(point, to: presentationNode.view), with: event)
}
- if let reactionContextNode = self.reactionContextNode {
- if let result = reactionContextNode.hitTest(self.view.convert(point, to: reactionContextNode.view), with: event) {
- return result
- }
- }
-
let mappedPoint = self.view.convert(point, to: self.scrollNode.view)
var maybePassthrough: ContextController.HandledTouchEvent?
if let maybeContentNode = self.contentContainerNode.contentNode {
diff --git a/submodules/ContextUI/Sources/ContextControllerExtractedPresentationNode.swift b/submodules/ContextUI/Sources/ContextControllerExtractedPresentationNode.swift
index 95211ba751..b81ca9f64d 100644
--- a/submodules/ContextUI/Sources/ContextControllerExtractedPresentationNode.swift
+++ b/submodules/ContextUI/Sources/ContextControllerExtractedPresentationNode.swift
@@ -724,11 +724,13 @@ final class ContextControllerExtractedPresentationNode: ASDisplayNode, ContextCo
var reactionAnchorRect = contentRect.offsetBy(dx: contentParentGlobalFrame.minX, dy: 0.0)
let bottomInset = layout.insets(options: [.input]).bottom
+ var isCoveredByInput = false
if reactionAnchorRect.minY > layout.size.height - bottomInset {
reactionAnchorRect.origin.y = layout.size.height - bottomInset
+ isCoveredByInput = true
}
- reactionContextNode.updateLayout(size: layout.size, insets: UIEdgeInsets(top: topInset, left: layout.safeInsets.left, bottom: 0.0, right: layout.safeInsets.right), anchorRect: reactionAnchorRect, isAnimatingOut: isAnimatingOut, transition: reactionContextNodeTransition)
+ reactionContextNode.updateLayout(size: layout.size, insets: UIEdgeInsets(top: topInset, left: layout.safeInsets.left, bottom: 0.0, right: layout.safeInsets.right), anchorRect: reactionAnchorRect, isCoveredByInput: isCoveredByInput, isAnimatingOut: isAnimatingOut, transition: reactionContextNodeTransition)
self.proposedReactionsPositionLock = contentRect.minY - 18.0 - reactionContextNode.contentHeight - 46.0
} else {
diff --git a/submodules/DebugSettingsUI/Sources/DebugController.swift b/submodules/DebugSettingsUI/Sources/DebugController.swift
index da35eaf19e..5a194093d4 100644
--- a/submodules/DebugSettingsUI/Sources/DebugController.swift
+++ b/submodules/DebugSettingsUI/Sources/DebugController.swift
@@ -573,7 +573,8 @@ private enum DebugControllerEntry: ItemListNodeEntry {
})
case .sendNotificationLogs:
return ItemListDisclosureItem(presentationData: presentationData, title: "Send Notification Logs (Up to 40 MB)", label: "", sectionId: self.section, style: .blocks, action: {
- let _ = (Logger(rootPath: arguments.sharedContext.basePath, basePath: arguments.sharedContext.basePath + "/logs/notification-logs").collectLogs()
+ let logsPath = arguments.sharedContext.basePath + "/logs/notification-logs"
+ let _ = (Logger(rootPath: logsPath, basePath: logsPath).collectLogs()
|> deliverOnMainQueue).start(next: { logs in
let presentationData = arguments.sharedContext.currentPresentationData.with { $0 }
let actionSheet = ActionSheetController(presentationData: presentationData)
@@ -721,7 +722,8 @@ private enum DebugControllerEntry: ItemListNodeEntry {
var logByType: [Signal<(type: String, logs: [(String, String)]), NoError>] = []
for type in logTypes {
- logByType.append(Logger(rootPath: arguments.sharedContext.basePath, basePath: arguments.sharedContext.basePath + "/logs/\(type)").collectLogs()
+ let logsPath = arguments.sharedContext.basePath + "/logs/\(type)"
+ logByType.append(Logger(rootPath: logsPath, basePath: logsPath).collectLogs()
|> map { result -> (type: String, logs: [(String, String)]) in
return (type, result)
})
diff --git a/submodules/Display/Source/ViewController.swift b/submodules/Display/Source/ViewController.swift
index f699db47a4..b732c85d7b 100644
--- a/submodules/Display/Source/ViewController.swift
+++ b/submodules/Display/Source/ViewController.swift
@@ -375,7 +375,7 @@ public protocol CustomViewControllerNavigationDataSummary: AnyObject {
}
}
self.navigationBar?.item = self.navigationItem
- self.automaticallyAdjustsScrollViewInsets = false
+ //self.automaticallyAdjustsScrollViewInsets = false
self.scrollToTopWithTabBar = { [weak self] in
self?.scrollToTop?()
diff --git a/submodules/GameUI/Sources/GameControllerNode.swift b/submodules/GameUI/Sources/GameControllerNode.swift
index f86105cecf..d54b1fec04 100644
--- a/submodules/GameUI/Sources/GameControllerNode.swift
+++ b/submodules/GameUI/Sources/GameControllerNode.swift
@@ -65,8 +65,6 @@ final class GameControllerNode: ViewControllerTracingNode {
configuration.allowsInlineMediaPlayback = true
if #available(iOSApplicationExtension 10.0, iOS 10.0, *) {
configuration.mediaTypesRequiringUserActionForPlayback = []
- } else if #available(iOSApplicationExtension 9.0, iOS 9.0, *) {
- configuration.requiresUserActionForMediaPlayback = false
} else {
configuration.mediaPlaybackRequiresUserAction = false
}
diff --git a/submodules/Geocoding/Sources/Geocoding.swift b/submodules/Geocoding/Sources/Geocoding.swift
index e573efce2f..909196c4a4 100644
--- a/submodules/Geocoding/Sources/Geocoding.swift
+++ b/submodules/Geocoding/Sources/Geocoding.swift
@@ -1,4 +1,5 @@
import Foundation
+import Contacts
import CoreLocation
import SwiftSignalKit
@@ -15,10 +16,10 @@ public func geocodeLocation(address: String) -> Signal<[CLPlacemark]?, NoError>
}
}
-public func geocodeLocation(dictionary: [String: String]) -> Signal<(Double, Double)?, NoError> {
+public func geocodeLocation(address: CNPostalAddress) -> Signal<(Double, Double)?, NoError> {
return Signal { subscriber in
let geocoder = CLGeocoder()
- geocoder.geocodeAddressDictionary(dictionary, completionHandler: { placemarks, _ in
+ geocoder.geocodePostalAddress(address, completionHandler: { placemarks, _ in
if let location = placemarks?.first?.location {
subscriber.putNext((location.coordinate.latitude, location.coordinate.longitude))
} else {
diff --git a/submodules/LegacyComponents/PublicHeaders/LegacyComponents/PGCameraCaptureSession.h b/submodules/LegacyComponents/PublicHeaders/LegacyComponents/PGCameraCaptureSession.h
index 499ecdbae8..ba7a214ef1 100644
--- a/submodules/LegacyComponents/PublicHeaders/LegacyComponents/PGCameraCaptureSession.h
+++ b/submodules/LegacyComponents/PublicHeaders/LegacyComponents/PGCameraCaptureSession.h
@@ -8,7 +8,10 @@
@interface PGCameraCaptureSession : AVCaptureSession
@property (nonatomic, readonly) AVCaptureDevice *videoDevice;
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
@property (nonatomic, readonly) AVCaptureStillImageOutput *imageOutput;
+#pragma clang diagnostic pop
@property (nonatomic, readonly) AVCaptureVideoDataOutput *videoOutput;
@property (nonatomic, readonly) AVCaptureAudioDataOutput *audioOutput;
@property (nonatomic, readonly) AVCaptureMetadataOutput *metadataOutput;
diff --git a/submodules/LegacyComponents/Sources/ActionStage.mm b/submodules/LegacyComponents/Sources/ActionStage.mm
index daa7759af3..6d31634fab 100644
--- a/submodules/LegacyComponents/Sources/ActionStage.mm
+++ b/submodules/LegacyComponents/Sources/ActionStage.mm
@@ -6,7 +6,7 @@
#import "ASActor.h"
-#import
+#import
#include
#include
@@ -17,8 +17,8 @@ static dispatch_queue_t mainGraphQueue = nil;
static dispatch_queue_t globalGraphQueue = nil;
static dispatch_queue_t highPriorityGraphQueue = nil;
-static volatile OSSpinLock removeWatcherRequestsLock = OS_SPINLOCK_INIT;
-static volatile OSSpinLock removeWatcherFromPathRequestsLock = OS_SPINLOCK_INIT;
+static os_unfair_lock removeWatcherRequestsLock = OS_UNFAIR_LOCK_INIT;
+static os_unfair_lock removeWatcherFromPathRequestsLock = OS_UNFAIR_LOCK_INIT;
@interface ActionStage ()
{
@@ -790,11 +790,11 @@ ActionStage *ActionStageInstance()
}
bool alreadyExecuting = false;
- OSSpinLockLock(&removeWatcherRequestsLock);
+ os_unfair_lock_lock(&removeWatcherRequestsLock);
if (!_removeWatcherRequests.empty())
alreadyExecuting = true;
_removeWatcherRequests.push_back(watcherGraphHandle);
- OSSpinLockUnlock(&removeWatcherRequestsLock);
+ os_unfair_lock_unlock(&removeWatcherRequestsLock);
if (alreadyExecuting && ![self isCurrentQueueStageQueue])
return;
@@ -803,10 +803,10 @@ ActionStage *ActionStageInstance()
{
std::vector removeWatchers;
- OSSpinLockLock(&removeWatcherRequestsLock);
+ os_unfair_lock_lock(&removeWatcherRequestsLock);
removeWatchers.insert(removeWatchers.begin(), _removeWatcherRequests.begin(), _removeWatcherRequests.end());
_removeWatcherRequests.clear();
- OSSpinLockUnlock(&removeWatcherRequestsLock);
+ os_unfair_lock_unlock(&removeWatcherRequestsLock);
for (std::vector::iterator it = removeWatchers.begin(); it != removeWatchers.end(); it++)
{
@@ -894,11 +894,11 @@ ActionStage *ActionStageInstance()
}
bool alreadyExecuting = false;
- OSSpinLockLock(&removeWatcherFromPathRequestsLock);
+ os_unfair_lock_lock(&removeWatcherFromPathRequestsLock);
if (!_removeWatcherFromPathRequests.empty())
alreadyExecuting = true;
_removeWatcherFromPathRequests.push_back(std::pair(watcherGraphHandle, watcherPath));
- OSSpinLockUnlock(&removeWatcherFromPathRequestsLock);
+ os_unfair_lock_unlock(&removeWatcherFromPathRequestsLock);
if (alreadyExecuting && ![self isCurrentQueueStageQueue])
return;
@@ -907,10 +907,10 @@ ActionStage *ActionStageInstance()
{
std::vector > removeWatchersFromPath;
- OSSpinLockLock(&removeWatcherFromPathRequestsLock);
+ os_unfair_lock_lock(&removeWatcherFromPathRequestsLock);
removeWatchersFromPath.insert(removeWatchersFromPath.begin(), _removeWatcherFromPathRequests.begin(), _removeWatcherFromPathRequests.end());
_removeWatcherFromPathRequests.clear();
- OSSpinLockUnlock(&removeWatcherFromPathRequestsLock);
+ os_unfair_lock_unlock(&removeWatcherFromPathRequestsLock);
if (removeWatchersFromPath.size() > 1)
{
diff --git a/submodules/LegacyComponents/Sources/POPAnimator.mm b/submodules/LegacyComponents/Sources/POPAnimator.mm
index c93a8a8cb0..fa9a6390f1 100644
--- a/submodules/LegacyComponents/Sources/POPAnimator.mm
+++ b/submodules/LegacyComponents/Sources/POPAnimator.mm
@@ -21,9 +21,7 @@
#import "POPBasicAnimationInternal.h"
#import "POPDecayAnimation.h"
-#if !TARGET_OS_IPHONE
-#import
-#endif
+#import
using namespace std;
using namespace POP;
@@ -97,7 +95,7 @@ static BOOL _disableBackgroundThread = YES;
CFTimeInterval _slowMotionLastTime;
CFTimeInterval _slowMotionAccumulator;
CFTimeInterval _beginTime;
- OSSpinLock _lock;
+ os_unfair_lock _lock;
BOOL _disableDisplayLink;
}
@end
@@ -263,7 +261,7 @@ static POPAnimation *deleteDictEntry(POPAnimator *self, id __unsafe_unretained o
POPAnimation *anim = nil;
// lock
- OSSpinLockLock(&self->_lock);
+ os_unfair_lock_lock(&self->_lock);
NSMutableDictionary *keyAnimationsDict = (__bridge id)CFDictionaryGetValue(self->_dict, (__bridge void *)obj);
if (keyAnimationsDict) {
@@ -282,7 +280,7 @@ static POPAnimation *deleteDictEntry(POPAnimator *self, id __unsafe_unretained o
}
// unlock
- OSSpinLockUnlock(&self->_lock);
+ os_unfair_lock_unlock(&self->_lock);
return anim;
}
@@ -299,7 +297,7 @@ static void stopAndCleanup(POPAnimator *self, POPAnimatorItemRef item, bool shou
if (shouldRemove) {
// lock
- OSSpinLockLock(&self->_lock);
+ os_unfair_lock_lock(&self->_lock);
// find item in list
// may have already been removed on animationDidStop:
@@ -311,7 +309,7 @@ static void stopAndCleanup(POPAnimator *self, POPAnimatorItemRef item, bool shou
}
// unlock
- OSSpinLockUnlock(&self->_lock);
+ os_unfair_lock_unlock(&self->_lock);
}
}
@@ -352,7 +350,7 @@ static void stopAndCleanup(POPAnimator *self, POPAnimatorItemRef item, bool shou
#endif
_dict = POPDictionaryCreateMutableWeakPointerToStrongObject(5);
- _lock = OS_SPINLOCK_INIT;
+ _lock = OS_UNFAIR_LOCK_INIT;
return self;
}
@@ -377,14 +375,14 @@ static void stopAndCleanup(POPAnimator *self, POPAnimatorItemRef item, bool shou
[self _renderTime:(0 != _beginTime) ? _beginTime : time items:_pendingList];
// lock
- OSSpinLockLock(&_lock);
+ os_unfair_lock_lock(&_lock);
// clear list and observer
_pendingList.clear();
[self _clearPendingListObserver];
// unlock
- OSSpinLockUnlock(&_lock);
+ os_unfair_lock_unlock(&_lock);
}
- (void)_clearPendingListObserver
@@ -403,7 +401,7 @@ static void stopAndCleanup(POPAnimator *self, POPAnimatorItemRef item, bool shou
static const CFIndex POPAnimationApplyRunLoopOrder = CATransactionCommitRunLoopOrder - 1;
// lock
- OSSpinLockLock(&_lock);
+ os_unfair_lock_lock(&_lock);
if (!_pendingListObserver) {
__weak POPAnimator *weakSelf = self;
@@ -418,7 +416,7 @@ static void stopAndCleanup(POPAnimator *self, POPAnimatorItemRef item, bool shou
}
// unlock
- OSSpinLockUnlock(&_lock);
+ os_unfair_lock_unlock(&_lock);
}
- (void)_renderTime:(CFTimeInterval)time items:(std::list)items
@@ -432,19 +430,19 @@ static void stopAndCleanup(POPAnimator *self, POPAnimatorItemRef item, bool shou
[delegate animatorWillAnimate:self];
// lock
- OSSpinLockLock(&_lock);
+ os_unfair_lock_lock(&_lock);
// count active animations
const NSUInteger count = items.size();
if (0 == count) {
// unlock
- OSSpinLockUnlock(&_lock);
+ os_unfair_lock_unlock(&_lock);
} else {
// copy list into vector
std::vector vector{ std::begin(items), std::end(items) };
// unlock
- OSSpinLockUnlock(&_lock);
+ os_unfair_lock_unlock(&_lock);
for (auto item : vector) {
[self _renderTime:time item:item];
@@ -457,13 +455,13 @@ static void stopAndCleanup(POPAnimator *self, POPAnimatorItemRef item, bool shou
}
// lock
- OSSpinLockLock(&_lock);
+ os_unfair_lock_lock(&_lock);
// update display link
updateDisplayLink(self);
// unlock
- OSSpinLockUnlock(&_lock);
+ os_unfair_lock_unlock(&_lock);
// notify delegate and commit
[delegate animatorDidAnimate:self];
@@ -541,13 +539,13 @@ static void stopAndCleanup(POPAnimator *self, POPAnimatorItemRef item, bool shou
- (NSArray *)observers
{
// lock
- OSSpinLockLock(&_lock);
+ os_unfair_lock_lock(&_lock);
// get observers
NSArray *observers = 0 != _observers.count ? [_observers copy] : nil;
// unlock
- OSSpinLockUnlock(&_lock);
+ os_unfair_lock_unlock(&_lock);
return observers;
}
@@ -563,7 +561,7 @@ static void stopAndCleanup(POPAnimator *self, POPAnimatorItemRef item, bool shou
}
// lock
- OSSpinLockLock(&_lock);
+ os_unfair_lock_lock(&_lock);
// get key, animation dict associated with object
NSMutableDictionary *keyAnimationDict = (__bridge id)CFDictionaryGetValue(_dict, (__bridge void *)obj);
@@ -577,7 +575,7 @@ static void stopAndCleanup(POPAnimator *self, POPAnimatorItemRef item, bool shou
POPAnimation *existingAnim = keyAnimationDict[key];
if (existingAnim) {
// unlock
- OSSpinLockUnlock(&_lock);
+ os_unfair_lock_unlock(&_lock);
if (existingAnim == anim) {
return;
@@ -585,7 +583,7 @@ static void stopAndCleanup(POPAnimator *self, POPAnimatorItemRef item, bool shou
[self removeAnimationForObject:obj key:key cleanupDict:NO];
// lock
- OSSpinLockLock(&_lock);
+ os_unfair_lock_lock(&_lock);
}
}
keyAnimationDict[key] = anim;
@@ -604,7 +602,7 @@ static void stopAndCleanup(POPAnimator *self, POPAnimatorItemRef item, bool shou
updateDisplayLink(self);
// unlock
- OSSpinLockUnlock(&_lock);
+ os_unfair_lock_unlock(&_lock);
// schedule runloop processing of pending animations
[self _scheduleProcessPendingList];
@@ -613,13 +611,13 @@ static void stopAndCleanup(POPAnimator *self, POPAnimatorItemRef item, bool shou
- (void)removeAllAnimationsForObject:(id)obj
{
// lock
- OSSpinLockLock(&_lock);
+ os_unfair_lock_lock(&_lock);
NSArray *animations = [(__bridge id)CFDictionaryGetValue(_dict, (__bridge void *)obj) allValues];
CFDictionaryRemoveValue(_dict, (__bridge void *)obj);
// unlock
- OSSpinLockUnlock(&_lock);
+ os_unfair_lock_unlock(&_lock);
if (0 == animations.count) {
return;
@@ -631,7 +629,7 @@ static void stopAndCleanup(POPAnimator *self, POPAnimatorItemRef item, bool shou
}
// lock
- OSSpinLockLock(&_lock);
+ os_unfair_lock_lock(&_lock);
POPAnimatorItemRef item;
for (auto iter = _list.begin(); iter != _list.end();) {
@@ -644,7 +642,7 @@ static void stopAndCleanup(POPAnimator *self, POPAnimatorItemRef item, bool shou
}
// unlock
- OSSpinLockUnlock(&_lock);
+ os_unfair_lock_unlock(&_lock);
for (POPAnimation *anim in animations) {
POPAnimationState *state = POPAnimationGetState(anim);
@@ -660,7 +658,7 @@ static void stopAndCleanup(POPAnimator *self, POPAnimatorItemRef item, bool shou
}
// lock
- OSSpinLockLock(&_lock);
+ os_unfair_lock_lock(&_lock);
// remove from list
POPAnimatorItemRef item;
@@ -686,7 +684,7 @@ static void stopAndCleanup(POPAnimator *self, POPAnimatorItemRef item, bool shou
}
// unlock
- OSSpinLockUnlock(&_lock);
+ os_unfair_lock_unlock(&_lock);
// stop animation and callout
POPAnimationState *state = POPAnimationGetState(anim);
@@ -701,27 +699,27 @@ static void stopAndCleanup(POPAnimator *self, POPAnimatorItemRef item, bool shou
- (NSArray *)animationKeysForObject:(id)obj
{
// lock
- OSSpinLockLock(&_lock);
+ os_unfair_lock_lock(&_lock);
// get keys
NSArray *keys = [(__bridge id)CFDictionaryGetValue(_dict, (__bridge void *)obj) allKeys];
// unlock
- OSSpinLockUnlock(&_lock);
+ os_unfair_lock_unlock(&_lock);
return keys;
}
- (id)animationForObject:(id)obj key:(NSString *)key
{
// lock
- OSSpinLockLock(&_lock);
+ os_unfair_lock_lock(&_lock);
// lookup animation
NSDictionary *keyAnimationsDict = (__bridge id)CFDictionaryGetValue(_dict, (__bridge void *)obj);
POPAnimation *animation = keyAnimationsDict[key];
// unlock
- OSSpinLockUnlock(&_lock);
+ os_unfair_lock_unlock(&_lock);
return animation;
}
@@ -771,7 +769,7 @@ static void stopAndCleanup(POPAnimator *self, POPAnimatorItemRef item, bool shou
}
// lock
- OSSpinLockLock(&_lock);
+ os_unfair_lock_lock(&_lock);
if (!_observers) {
// use ordered collection for deterministic callout
@@ -782,7 +780,7 @@ static void stopAndCleanup(POPAnimator *self, POPAnimatorItemRef item, bool shou
updateDisplayLink(self);
// unlock
- OSSpinLockUnlock(&_lock);
+ os_unfair_lock_unlock(&_lock);
}
- (void)removeObserver:(id)observer
@@ -793,13 +791,13 @@ static void stopAndCleanup(POPAnimator *self, POPAnimatorItemRef item, bool shou
}
// lock
- OSSpinLockLock(&_lock);
+ os_unfair_lock_lock(&_lock);
[_observers removeObject:observer];
updateDisplayLink(self);
// unlock
- OSSpinLockUnlock(&_lock);
+ os_unfair_lock_unlock(&_lock);
}
@end
diff --git a/submodules/LegacyComponents/Sources/TGImageUtils.mm b/submodules/LegacyComponents/Sources/TGImageUtils.mm
index 0734f8b066..842ae8b272 100644
--- a/submodules/LegacyComponents/Sources/TGImageUtils.mm
+++ b/submodules/LegacyComponents/Sources/TGImageUtils.mm
@@ -5,7 +5,7 @@
#import
#import
-#import
+#import
#import