mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-07-22 19:21:11 +00:00
Cleanup
This commit is contained in:
parent
7512f7f017
commit
a23deded22
@ -1790,6 +1790,7 @@ ios_application(
|
|||||||
#"//third-party/boringssl:ssl",
|
#"//third-party/boringssl:ssl",
|
||||||
#"//third-party/boringssl:crypto",
|
#"//third-party/boringssl:crypto",
|
||||||
#"//submodules/TelegramVoip",
|
#"//submodules/TelegramVoip",
|
||||||
|
#"//third-party/libprisma",
|
||||||
"//submodules/TelegramUI",
|
"//submodules/TelegramUI",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
@ -45,6 +45,29 @@ def escape_swift_string_literal_component(text: str) -> str:
|
|||||||
# For non-define flags or defines without shell quoting, just escape for Swift string literal
|
# For non-define flags or defines without shell quoting, just escape for Swift string literal
|
||||||
return text.replace('\\', '\\\\').replace('"', '\\"')
|
return text.replace('\\', '\\\\').replace('"', '\\"')
|
||||||
|
|
||||||
|
# Parses -D flag into a tuple of (define_flag, define_value)
|
||||||
|
# Example: flag="ABC" -> (ABC, None)
|
||||||
|
# Example: flag="ABC=123" -> (ABC, 123)
|
||||||
|
# Example: flag="ABC=\"str\"" -> (ABC, "str")
|
||||||
|
def parse_define_flag(flag: str) -> tuple[str, str | None]:
|
||||||
|
if flag.startswith("-D"):
|
||||||
|
define_part = flag[2:]
|
||||||
|
else:
|
||||||
|
define_part = flag
|
||||||
|
|
||||||
|
# Check if there's an assignment
|
||||||
|
if "=" in define_part:
|
||||||
|
key, value = define_part.split("=", 1) # Split on first = only
|
||||||
|
|
||||||
|
# Handle quoted values - remove surrounding quotes if present
|
||||||
|
if (value.startswith('"') and value.endswith('"')) or (value.startswith("'") and value.endswith("'")):
|
||||||
|
value = value[1:-1] # Remove quotes
|
||||||
|
|
||||||
|
return (key, value)
|
||||||
|
else:
|
||||||
|
# No assignment, just a flag name
|
||||||
|
return (define_part, None)
|
||||||
|
|
||||||
parsed_modules = {}
|
parsed_modules = {}
|
||||||
for name, module in sorted(modules.items()):
|
for name, module in sorted(modules.items()):
|
||||||
is_empty = False
|
is_empty = False
|
||||||
@ -60,6 +83,8 @@ for name, module in sorted(modules.items()):
|
|||||||
"is_empty": is_empty,
|
"is_empty": is_empty,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
spm_products = []
|
||||||
|
spm_targets = []
|
||||||
module_to_source_files = dict()
|
module_to_source_files = dict()
|
||||||
modulemaps = dict()
|
modulemaps = dict()
|
||||||
|
|
||||||
@ -69,41 +94,136 @@ combined_lines.append("// The swift-tools-version declares the minimum version o
|
|||||||
combined_lines.append("")
|
combined_lines.append("")
|
||||||
combined_lines.append("import PackageDescription")
|
combined_lines.append("import PackageDescription")
|
||||||
combined_lines.append("import Foundation")
|
combined_lines.append("import Foundation")
|
||||||
|
combined_lines.append("""
|
||||||
|
func parseProduct(product: [String: Any]) -> Product {
|
||||||
|
let name = product[\"name\"] as! String
|
||||||
|
let targets = product[\"targets\"] as! [String]
|
||||||
|
return .library(name: name, targets: targets)
|
||||||
|
}""")
|
||||||
|
combined_lines.append("""
|
||||||
|
func parseTarget(target: [String: Any]) -> Target {
|
||||||
|
let name = target["name"] as! String
|
||||||
|
let dependencies = target["dependencies"] as! [String]
|
||||||
|
|
||||||
|
var swiftSettings: [SwiftSetting]?
|
||||||
|
if let swiftSettingList = target["swiftSettings"] as? [[String: Any]] {
|
||||||
|
var swiftSettingsValue: [SwiftSetting] = []
|
||||||
|
swiftSettingsValue.append(.swiftLanguageMode(.v5))
|
||||||
|
for swiftSetting in swiftSettingList {
|
||||||
|
if swiftSetting["type"] as! String == "define" {
|
||||||
|
swiftSettingsValue.append(.define(swiftSetting["name"] as! String))
|
||||||
|
} else if swiftSetting["type"] as! String == "unsafeFlags" {
|
||||||
|
swiftSettingsValue.append(.unsafeFlags(swiftSetting["flags"] as! [String]))
|
||||||
|
} else {
|
||||||
|
print("Unknown swift setting type: \\(swiftSetting["type"] as! String)")
|
||||||
|
preconditionFailure("Unknown swift setting type: \\(swiftSetting["type"] as! String)")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
swiftSettings = swiftSettingsValue
|
||||||
|
}
|
||||||
|
|
||||||
|
var cSettings: [CSetting]?
|
||||||
|
if let cSettingList = target["cSettings"] as? [[String: Any]] {
|
||||||
|
var cSettingsValue: [CSetting] = []
|
||||||
|
for cSetting in cSettingList {
|
||||||
|
if cSetting["type"] as! String == "define" {
|
||||||
|
cSettingsValue.append(.define(cSetting["name"] as! String))
|
||||||
|
} else if cSetting["type"] as! String == "unsafeFlags" {
|
||||||
|
cSettingsValue.append(.unsafeFlags(cSetting["flags"] as! [String]))
|
||||||
|
} else {
|
||||||
|
print("Unknown c setting type: \\(cSetting["type"] as! String)")
|
||||||
|
preconditionFailure("Unknown c setting type: \\(cSetting["type"] as! String)")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
cSettings = cSettingsValue
|
||||||
|
}
|
||||||
|
|
||||||
|
var cxxSettings: [CXXSetting]?
|
||||||
|
if let cxxSettingList = target["cxxSettings"] as? [[String: Any]] {
|
||||||
|
var cxxSettingsValue: [CXXSetting] = []
|
||||||
|
for cxxSetting in cxxSettingList {
|
||||||
|
if cxxSetting["type"] as! String == "define" {
|
||||||
|
cxxSettingsValue.append(.define(cxxSetting["name"] as! String))
|
||||||
|
} else if cxxSetting["type"] as! String == "unsafeFlags" {
|
||||||
|
cxxSettingsValue.append(.unsafeFlags(cxxSetting["flags"] as! [String]))
|
||||||
|
} else {
|
||||||
|
print("Unknown cxx setting type: \\(cxxSetting["type"] as! String)")
|
||||||
|
preconditionFailure("Unknown cxx setting type: \\(cxxSetting["type"] as! String)")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
cxxSettings = cxxSettingsValue
|
||||||
|
}
|
||||||
|
|
||||||
|
var linkerSettings: [LinkerSetting]?
|
||||||
|
if let linkerSettingList = target["linkerSettings"] as? [[String: Any]] {
|
||||||
|
var linkerSettingsValue: [LinkerSetting] = []
|
||||||
|
for linkerSetting in linkerSettingList {
|
||||||
|
if linkerSetting["type"] as! String == "framework" {
|
||||||
|
linkerSettingsValue.append(.linkedFramework(linkerSetting["name"] as! String))
|
||||||
|
} else if linkerSetting["type"] as! String == "library" {
|
||||||
|
linkerSettingsValue.append(.linkedLibrary(linkerSetting["name"] as! String))
|
||||||
|
} else {
|
||||||
|
print("Unknown linker setting type: \\(linkerSetting["type"] as! String)")
|
||||||
|
preconditionFailure("Unknown linker setting type: \\(linkerSetting["type"] as! String)")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
linkerSettings = linkerSettingsValue
|
||||||
|
}
|
||||||
|
|
||||||
|
return .target(
|
||||||
|
name: name,
|
||||||
|
dependencies: dependencies.map({ .target(name: $0) }),
|
||||||
|
path: (target["path"] as? String)!,
|
||||||
|
exclude: [],
|
||||||
|
sources: sourceFileMap[name]!,
|
||||||
|
resources: nil,
|
||||||
|
publicHeadersPath: target["publicHeadersPath"] as? String,
|
||||||
|
packageAccess: true,
|
||||||
|
cSettings: cSettings,
|
||||||
|
cxxSettings: cxxSettings,
|
||||||
|
swiftSettings: swiftSettings,
|
||||||
|
linkerSettings: linkerSettings,
|
||||||
|
plugins: nil
|
||||||
|
)
|
||||||
|
}
|
||||||
|
""")
|
||||||
combined_lines.append("")
|
combined_lines.append("")
|
||||||
combined_lines.append("let sourceFileMap: [String: [String]] = try! JSONSerialization.jsonObject(with: Data(contentsOf: URL(fileURLWithPath: \"SourceFileMap.json\")), options: []) as! [String: [String]]")
|
combined_lines.append("let packageData: [String: Any] = try! JSONSerialization.jsonObject(with: Data(contentsOf: URL(fileURLWithPath: \"PackageData.json\")), options: []) as! [String: Any]")
|
||||||
|
combined_lines.append("let sourceFileMap: [String: [String]] = packageData[\"sourceFileMap\"] as! [String: [String]]")
|
||||||
|
combined_lines.append("let products: [Product] = (packageData[\"products\"] as! [[String: Any]]).map(parseProduct)")
|
||||||
|
combined_lines.append("let targets: [Target] = (packageData[\"targets\"] as! [[String: Any]]).map(parseTarget)")
|
||||||
combined_lines.append("")
|
combined_lines.append("")
|
||||||
combined_lines.append("let package = Package(")
|
combined_lines.append("let package = Package(")
|
||||||
combined_lines.append(" name: \"Telegram\",")
|
combined_lines.append(" name: \"Telegram\",")
|
||||||
combined_lines.append(" platforms: [")
|
combined_lines.append(" platforms: [")
|
||||||
combined_lines.append(" .iOS(.v13)")
|
combined_lines.append(" .iOS(.v13)")
|
||||||
combined_lines.append(" ],")
|
combined_lines.append(" ],")
|
||||||
combined_lines.append(" products: [")
|
combined_lines.append(" products: products,")
|
||||||
|
|
||||||
for name, module in sorted(modules.items()):
|
for name, module in sorted(modules.items()):
|
||||||
if parsed_modules[name]["is_empty"]:
|
if parsed_modules[name]["is_empty"]:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if module["type"] == "objc_library" or module["type"] == "swift_library" or module["type"] == "cc_library":
|
if module["type"] == "objc_library" or module["type"] == "swift_library" or module["type"] == "cc_library":
|
||||||
combined_lines.append(" .library(name: \"%s\", targets: [\"%s\"])," % (module["name"], module["name"]))
|
spm_products.append({
|
||||||
|
"name": module["name"],
|
||||||
|
"targets": [module["name"]],
|
||||||
|
})
|
||||||
|
|
||||||
combined_lines.append(" ],")
|
|
||||||
combined_lines.append(" targets: [")
|
combined_lines.append(" targets: [")
|
||||||
|
|
||||||
class ModulemapStore:
|
|
||||||
def __init__(self) -> None:
|
|
||||||
pass
|
|
||||||
|
|
||||||
def add(self, module_path, header_path):
|
|
||||||
pass
|
|
||||||
|
|
||||||
for name, module in sorted(modules.items()):
|
for name, module in sorted(modules.items()):
|
||||||
if parsed_modules[name]["is_empty"]:
|
if parsed_modules[name]["is_empty"]:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
module_type = module["type"]
|
module_type = module["type"]
|
||||||
if module_type == "objc_library" or module_type == "cc_library" or module_type == "swift_library":
|
if module_type == "objc_library" or module_type == "cc_library" or module_type == "swift_library":
|
||||||
|
spm_target = dict()
|
||||||
|
|
||||||
combined_lines.append(" .target(")
|
combined_lines.append(" .target(")
|
||||||
combined_lines.append(" name: \"%s\"," % name)
|
combined_lines.append(" name: \"%s\"," % name)
|
||||||
|
spm_target["name"] = name
|
||||||
|
|
||||||
relative_module_path = module["path"]
|
relative_module_path = module["path"]
|
||||||
module_directory = spm_files_dir + "/" + relative_module_path
|
module_directory = spm_files_dir + "/" + relative_module_path
|
||||||
@ -122,13 +242,16 @@ for name, module in sorted(modules.items()):
|
|||||||
break
|
break
|
||||||
|
|
||||||
combined_lines.append(" dependencies: [")
|
combined_lines.append(" dependencies: [")
|
||||||
|
spm_target["dependencies"] = []
|
||||||
for dep in module["deps"]:
|
for dep in module["deps"]:
|
||||||
if not parsed_modules[dep]["is_empty"]:
|
if not parsed_modules[dep]["is_empty"]:
|
||||||
combined_lines.append(" .target(name: \"%s\")," % dep)
|
combined_lines.append(" .target(name: \"%s\")," % dep)
|
||||||
|
spm_target["dependencies"].append(dep)
|
||||||
combined_lines.append(" ],")
|
combined_lines.append(" ],")
|
||||||
|
|
||||||
# All modules now use the symlinked directory path
|
# All modules now use the symlinked directory path
|
||||||
combined_lines.append(" path: \"%s\"," % relative_module_path)
|
combined_lines.append(" path: \"%s\"," % relative_module_path)
|
||||||
|
spm_target["path"] = relative_module_path
|
||||||
|
|
||||||
include_source_files = []
|
include_source_files = []
|
||||||
exclude_source_files = []
|
exclude_source_files = []
|
||||||
@ -188,6 +311,7 @@ for name, module in sorted(modules.items()):
|
|||||||
exclude_path = other_module["path"][len(module["path"]) + 1:]
|
exclude_path = other_module["path"][len(module["path"]) + 1:]
|
||||||
ignore_sub_folders.append(exclude_path)
|
ignore_sub_folders.append(exclude_path)
|
||||||
if len(ignore_sub_folders) != 0:
|
if len(ignore_sub_folders) != 0:
|
||||||
|
spm_target["exclude"] = ignore_sub_folders
|
||||||
combined_lines.append(" exclude: [")
|
combined_lines.append(" exclude: [")
|
||||||
for sub_folder in ignore_sub_folders:
|
for sub_folder in ignore_sub_folders:
|
||||||
combined_lines.append(f" \"{sub_folder}\",")
|
combined_lines.append(f" \"{sub_folder}\",")
|
||||||
@ -206,8 +330,10 @@ for name, module in sorted(modules.items()):
|
|||||||
if module_type == "objc_library" or module_type == "cc_library":
|
if module_type == "objc_library" or module_type == "cc_library":
|
||||||
if module_public_headers_prefix is not None and len(module_public_headers_prefix) != 0:
|
if module_public_headers_prefix is not None and len(module_public_headers_prefix) != 0:
|
||||||
combined_lines.append(f" publicHeadersPath: \"{module_public_headers_prefix}\",")
|
combined_lines.append(f" publicHeadersPath: \"{module_public_headers_prefix}\",")
|
||||||
|
spm_target["publicHeadersPath"] = module_public_headers_prefix
|
||||||
else:
|
else:
|
||||||
combined_lines.append(" publicHeadersPath: \"\",")
|
combined_lines.append(" publicHeadersPath: \"\",")
|
||||||
|
spm_target["publicHeadersPath"] = ""
|
||||||
|
|
||||||
if len(module["includes"]) > 1:
|
if len(module["includes"]) > 1:
|
||||||
print("{}: Multiple includes are not yet supported: {}".format(name, module["includes"]))
|
print("{}: Multiple includes are not yet supported: {}".format(name, module["includes"]))
|
||||||
@ -217,7 +343,9 @@ for name, module in sorted(modules.items()):
|
|||||||
cxxopts = module.get("cxxopts", [])
|
cxxopts = module.get("cxxopts", [])
|
||||||
|
|
||||||
if defines or copts or (module_public_headers_prefix is not None):
|
if defines or copts or (module_public_headers_prefix is not None):
|
||||||
|
spm_target["cSettings"] = []
|
||||||
combined_lines.append(" cSettings: [")
|
combined_lines.append(" cSettings: [")
|
||||||
|
|
||||||
if defines:
|
if defines:
|
||||||
for define in defines:
|
for define in defines:
|
||||||
if "=" in define:
|
if "=" in define:
|
||||||
@ -225,30 +353,43 @@ for name, module in sorted(modules.items()):
|
|||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
else:
|
else:
|
||||||
combined_lines.append(f' .define("{define}"),')
|
combined_lines.append(f' .define("{define}"),')
|
||||||
|
spm_target["cSettings"].append({
|
||||||
|
"type": "define",
|
||||||
|
"name": define
|
||||||
|
})
|
||||||
|
define_flags = []
|
||||||
if copts:
|
if copts:
|
||||||
combined_lines.append(" .unsafeFlags([")
|
combined_lines.append(" .unsafeFlags([")
|
||||||
|
unsafe_flags = []
|
||||||
for flag in copts:
|
for flag in copts:
|
||||||
escaped_flag = escape_swift_string_literal_component(flag)
|
if flag.startswith("-D"):
|
||||||
if escaped_flag.startswith("-I") and False:
|
define_flag, define_value = parse_define_flag(flag)
|
||||||
include_path = escaped_flag[2:]
|
define_flags.append((define_flag, define_value))
|
||||||
#print("{}: Include path: {}".format(name, include_path))
|
spm_target["cSettings"].append({
|
||||||
found_reference = False
|
"type": "define",
|
||||||
for another_module_name, another_module in sorted(modules.items()):
|
"name": define_flag,
|
||||||
another_module_path = another_module["path"]
|
"value": define_value
|
||||||
if include_path.startswith(another_module_path):
|
})
|
||||||
combined_lines.append(f' "-I{include_path}",')
|
|
||||||
found_reference = True
|
|
||||||
if not found_reference:
|
|
||||||
print(f"{name}: Unresolved include path: {include_path}")
|
|
||||||
sys.exit(1)
|
|
||||||
else:
|
else:
|
||||||
|
escaped_flag = escape_swift_string_literal_component(flag)
|
||||||
combined_lines.append(f' "{escaped_flag}",')
|
combined_lines.append(f' "{escaped_flag}",')
|
||||||
|
unsafe_flags.append(escaped_flag)
|
||||||
combined_lines.append(" ]),")
|
combined_lines.append(" ]),")
|
||||||
#if module_public_headers_prefix is not None:
|
spm_target["cSettings"].append({
|
||||||
# combined_lines.append(f" .headerSearchPath(\"{module_public_headers_prefix}\"),")
|
"type": "unsafeFlags",
|
||||||
|
"flags": unsafe_flags
|
||||||
|
})
|
||||||
|
if len(define_flags) != 0:
|
||||||
|
for (define_flag, define_value) in define_flags:
|
||||||
|
if define_value is None:
|
||||||
|
combined_lines.append(f' .define("{define_flag}"),')
|
||||||
|
else:
|
||||||
|
combined_lines.append(f' .define("{define_flag}", to: "{define_value}"),')
|
||||||
|
|
||||||
combined_lines.append(" ],")
|
combined_lines.append(" ],")
|
||||||
|
|
||||||
if defines or cxxopts: # Check for defines OR cxxopts
|
if defines or cxxopts: # Check for defines OR cxxopts
|
||||||
|
spm_target["cxxSettings"] = []
|
||||||
combined_lines.append(" cxxSettings: [")
|
combined_lines.append(" cxxSettings: [")
|
||||||
if defines: # Add defines again if present, for C++ context
|
if defines: # Add defines again if present, for C++ context
|
||||||
for define in defines:
|
for define in defines:
|
||||||
@ -257,8 +398,13 @@ for name, module in sorted(modules.items()):
|
|||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
else:
|
else:
|
||||||
combined_lines.append(f' .define("{define}"),')
|
combined_lines.append(f' .define("{define}"),')
|
||||||
|
spm_target["cxxSettings"].append({
|
||||||
|
"type": "define",
|
||||||
|
"name": define
|
||||||
|
})
|
||||||
if cxxopts:
|
if cxxopts:
|
||||||
combined_lines.append(" .unsafeFlags([")
|
combined_lines.append(" .unsafeFlags([")
|
||||||
|
unsafe_flags = []
|
||||||
for flag in cxxopts:
|
for flag in cxxopts:
|
||||||
if flag.startswith("-std=") and True:
|
if flag.startswith("-std=") and True:
|
||||||
if flag != "-std=c++17":
|
if flag != "-std=c++17":
|
||||||
@ -268,15 +414,33 @@ for name, module in sorted(modules.items()):
|
|||||||
continue
|
continue
|
||||||
escaped_flag = escape_swift_string_literal_component(flag)
|
escaped_flag = escape_swift_string_literal_component(flag)
|
||||||
combined_lines.append(f' "{escaped_flag}",')
|
combined_lines.append(f' "{escaped_flag}",')
|
||||||
|
unsafe_flags.append(escaped_flag)
|
||||||
combined_lines.append(" ])")
|
combined_lines.append(" ])")
|
||||||
|
spm_target["cxxSettings"].append({
|
||||||
|
"type": "unsafeFlags",
|
||||||
|
"flags": unsafe_flags
|
||||||
|
})
|
||||||
combined_lines.append(" ],")
|
combined_lines.append(" ],")
|
||||||
|
|
||||||
|
spm_target["linkerSettings"] = []
|
||||||
combined_lines.append(" linkerSettings: [")
|
combined_lines.append(" linkerSettings: [")
|
||||||
if module_type == "objc_library":
|
if module_type == "objc_library":
|
||||||
for framework in module["sdk_frameworks"]:
|
for framework in module["sdk_frameworks"]:
|
||||||
combined_lines.append(" .linkedFramework(\"%s\")," % framework)
|
combined_lines.append(" .linkedFramework(\"%s\")," % framework)
|
||||||
|
spm_target["linkerSettings"].append({
|
||||||
|
"type": "framework",
|
||||||
|
"name": framework
|
||||||
|
})
|
||||||
for dylib in module["sdk_dylibs"]:
|
for dylib in module["sdk_dylibs"]:
|
||||||
combined_lines.append(" .linkedLibrary(\"%s\")," % dylib)
|
combined_lines.append(" .linkedLibrary(\"%s\")," % dylib)
|
||||||
|
spm_target["linkerSettings"].append({
|
||||||
|
"type": "library",
|
||||||
|
"name": dylib
|
||||||
|
})
|
||||||
|
spm_target["linkerSettings"].append({
|
||||||
|
"type": "library",
|
||||||
|
"name": dylib
|
||||||
|
})
|
||||||
combined_lines.append(" ]")
|
combined_lines.append(" ]")
|
||||||
|
|
||||||
elif module_type == "swift_library":
|
elif module_type == "swift_library":
|
||||||
@ -286,10 +450,16 @@ for name, module in sorted(modules.items()):
|
|||||||
# Handle cSettings for defines if they exist
|
# Handle cSettings for defines if they exist
|
||||||
if defines:
|
if defines:
|
||||||
combined_lines.append(" cSettings: [")
|
combined_lines.append(" cSettings: [")
|
||||||
|
spm_target["cSettings"] = []
|
||||||
for define in defines:
|
for define in defines:
|
||||||
combined_lines.append(f' .define("{define}"),')
|
combined_lines.append(f' .define("{define}"),')
|
||||||
|
spm_target["cSettings"].append({
|
||||||
|
"type": "define",
|
||||||
|
"name": define
|
||||||
|
})
|
||||||
combined_lines.append(" ],")
|
combined_lines.append(" ],")
|
||||||
|
|
||||||
|
spm_target["swiftSettings"] = []
|
||||||
# Handle swiftSettings
|
# Handle swiftSettings
|
||||||
combined_lines.append(" swiftSettings: [")
|
combined_lines.append(" swiftSettings: [")
|
||||||
combined_lines.append(" .swiftLanguageMode(.v5),")
|
combined_lines.append(" .swiftLanguageMode(.v5),")
|
||||||
@ -299,16 +469,28 @@ for name, module in sorted(modules.items()):
|
|||||||
# For Swift settings, the define is passed as a single string, e.g., "KEY=VALUE" or "FLAG"
|
# For Swift settings, the define is passed as a single string, e.g., "KEY=VALUE" or "FLAG"
|
||||||
escaped_define = escape_swift_string_literal_component(define) # Escape the whole define string
|
escaped_define = escape_swift_string_literal_component(define) # Escape the whole define string
|
||||||
combined_lines.append(f' .define("{escaped_define}"),')
|
combined_lines.append(f' .define("{escaped_define}"),')
|
||||||
|
spm_target["swiftSettings"].append({
|
||||||
|
"type": "define",
|
||||||
|
"name": define
|
||||||
|
})
|
||||||
|
|
||||||
# Add copts (swiftc flags) to unsafeFlags in swiftSettings
|
# Add copts (swiftc flags) to unsafeFlags in swiftSettings
|
||||||
if swift_copts:
|
if swift_copts:
|
||||||
combined_lines.append(" .unsafeFlags([")
|
combined_lines.append(" .unsafeFlags([")
|
||||||
|
unsafe_flags = []
|
||||||
for flag in swift_copts:
|
for flag in swift_copts:
|
||||||
escaped_flag = escape_swift_string_literal_component(flag)
|
escaped_flag = escape_swift_string_literal_component(flag)
|
||||||
combined_lines.append(f' "{escaped_flag}",')
|
combined_lines.append(f' "{escaped_flag}",')
|
||||||
|
unsafe_flags.append(escaped_flag)
|
||||||
combined_lines.append(" ])")
|
combined_lines.append(" ])")
|
||||||
|
spm_target["swiftSettings"].append({
|
||||||
|
"type": "unsafeFlags",
|
||||||
|
"flags": unsafe_flags
|
||||||
|
})
|
||||||
combined_lines.append(" ]")
|
combined_lines.append(" ]")
|
||||||
combined_lines.append(" ),")
|
combined_lines.append(" ),")
|
||||||
|
|
||||||
|
spm_targets.append(spm_target)
|
||||||
elif module["type"] == "root":
|
elif module["type"] == "root":
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
@ -323,8 +505,13 @@ combined_lines.append("")
|
|||||||
with open("spm-files/Package.swift", "w") as f:
|
with open("spm-files/Package.swift", "w") as f:
|
||||||
f.write("\n".join(combined_lines))
|
f.write("\n".join(combined_lines))
|
||||||
|
|
||||||
with open("spm-files/SourceFileMap.json", "w") as f:
|
with open("spm-files/PackageData.json", "w") as f:
|
||||||
json.dump(module_to_source_files, f, indent=4)
|
package_data = {
|
||||||
|
"sourceFileMap": module_to_source_files,
|
||||||
|
"products": spm_products,
|
||||||
|
"targets": spm_targets
|
||||||
|
}
|
||||||
|
json.dump(package_data, f, indent=4)
|
||||||
|
|
||||||
for modulemap_path, modulemap in modulemaps.items():
|
for modulemap_path, modulemap in modulemaps.items():
|
||||||
module_map_contents = ""
|
module_map_contents = ""
|
||||||
|
@ -6,6 +6,7 @@ import AsyncDisplayKit
|
|||||||
import YuvConversion
|
import YuvConversion
|
||||||
import MediaResources
|
import MediaResources
|
||||||
import AnimationCompression
|
import AnimationCompression
|
||||||
|
import UIKit
|
||||||
|
|
||||||
private let sharedQueue = Queue()
|
private let sharedQueue = Queue()
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
|
import UIKit
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
|
|
||||||
public enum AnimationRendererFrameType {
|
public enum AnimationRendererFrameType {
|
||||||
|
@ -8,6 +8,7 @@ import ManagedFile
|
|||||||
import Accelerate
|
import Accelerate
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import WebPBinding
|
import WebPBinding
|
||||||
|
import UIKit
|
||||||
|
|
||||||
private let sharedStoreQueue = Queue.concurrentDefaultQueue()
|
private let sharedStoreQueue = Queue.concurrentDefaultQueue()
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
|
import UIKit
|
||||||
import Display
|
import Display
|
||||||
import TelegramPresentationData
|
import TelegramPresentationData
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
|
@ -14,6 +14,7 @@ swift_library(
|
|||||||
"//submodules/TelegramCore:TelegramCore",
|
"//submodules/TelegramCore:TelegramCore",
|
||||||
"//submodules/Postbox:Postbox",
|
"//submodules/Postbox:Postbox",
|
||||||
"//submodules/Display:Display",
|
"//submodules/Display:Display",
|
||||||
|
"//submodules/SSignalKit/SSignalKit",
|
||||||
"//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit",
|
"//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit",
|
||||||
"//submodules/TextFormat:TextFormat",
|
"//submodules/TextFormat:TextFormat",
|
||||||
"//submodules/Markdown:Markdown",
|
"//submodules/Markdown:Markdown",
|
||||||
|
@ -22,6 +22,7 @@ import Markdown
|
|||||||
import AlertUI
|
import AlertUI
|
||||||
import InAppPurchaseManager
|
import InAppPurchaseManager
|
||||||
import ObjectiveC
|
import ObjectiveC
|
||||||
|
import AVFoundation
|
||||||
|
|
||||||
private var ObjCKey_Delegate: Int?
|
private var ObjCKey_Delegate: Int?
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@ import Display
|
|||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import Postbox
|
import Postbox
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
|
import SSignalKit
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
import TelegramPresentationData
|
import TelegramPresentationData
|
||||||
import LegacyComponents
|
import LegacyComponents
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
import Foundation
|
||||||
|
import UIKit
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import Display
|
import Display
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
|
import Foundation
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
|
import UIKit
|
||||||
import Display
|
import Display
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
|
@ -3,6 +3,7 @@ import ComponentFlow
|
|||||||
import Lottie
|
import Lottie
|
||||||
import AppBundle
|
import AppBundle
|
||||||
import HierarchyTrackingLayer
|
import HierarchyTrackingLayer
|
||||||
|
import UIKit
|
||||||
import Display
|
import Display
|
||||||
import GZip
|
import GZip
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
|
import UIKit
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import Display
|
import Display
|
||||||
import TelegramPresentationData
|
import TelegramPresentationData
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
|
import UIKit
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import Display
|
import Display
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
|
import UIKit
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import Display
|
import Display
|
||||||
import TelegramPresentationData
|
import TelegramPresentationData
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
|
import UIKit
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
|
|
||||||
public final class ContextContentContainerNode: ASDisplayNode {
|
public final class ContextContentContainerNode: ASDisplayNode {
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
|
import UIKit
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
|
|
||||||
open class ContextReferenceContentNode: ASDisplayNode {
|
open class ContextReferenceContentNode: ASDisplayNode {
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
|
import UIKit
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
|
|
||||||
open class ContextControllerSourceNode: ContextReferenceContentNode {
|
open class ContextControllerSourceNode: ContextReferenceContentNode {
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
|
import UIKit
|
||||||
import UIKitRuntimeUtils
|
import UIKitRuntimeUtils
|
||||||
|
|
||||||
public enum Keyboard {
|
public enum Keyboard {
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
|
import UIKit
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
|
|
||||||
public protocol MinimizedContainer: ASDisplayNode {
|
public protocol MinimizedContainer: ASDisplayNode {
|
||||||
|
@ -9,6 +9,9 @@ objc_library(
|
|||||||
hdrs = glob([
|
hdrs = glob([
|
||||||
"Sources/**/*.h",
|
"Sources/**/*.h",
|
||||||
]),
|
]),
|
||||||
|
includes = [
|
||||||
|
"Sources",
|
||||||
|
],
|
||||||
sdk_dylibs = [
|
sdk_dylibs = [
|
||||||
"libz",
|
"libz",
|
||||||
],
|
],
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
import Display
|
import Display
|
||||||
|
import UIKit
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
|
|
||||||
|
@ -1,8 +1,12 @@
|
|||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
#import <SSignalKit/SSignalKit.h>
|
#import <SSignalKit/SSignalKit.h>
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
@interface TGGifConverter : NSObject
|
@interface TGGifConverter : NSObject
|
||||||
|
|
||||||
+ (SSignal *)convertGifToMp4:(NSData *)data;
|
+ (SSignal *)convertGifToMp4:(NSData *)data;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
#import <Foundation/Foundation.h>
|
||||||
#import <SSignalKit/SSignalKit.h>
|
#import <SSignalKit/SSignalKit.h>
|
||||||
|
|
||||||
@protocol TGMediaSelectableItem
|
@protocol TGMediaSelectableItem
|
||||||
|
@ -10,6 +10,7 @@ swift_library(
|
|||||||
"-warnings-as-errors",
|
"-warnings-as-errors",
|
||||||
],
|
],
|
||||||
deps = [
|
deps = [
|
||||||
|
"//submodules/SSignalKit/SSignalKit",
|
||||||
"//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit",
|
"//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit",
|
||||||
"//submodules/AsyncDisplayKit:AsyncDisplayKit",
|
"//submodules/AsyncDisplayKit:AsyncDisplayKit",
|
||||||
"//submodules/Display:Display",
|
"//submodules/Display:Display",
|
||||||
|
@ -10,6 +10,7 @@ import DeviceAccess
|
|||||||
import AccountContext
|
import AccountContext
|
||||||
import LegacyUI
|
import LegacyUI
|
||||||
import SaveToCameraRoll
|
import SaveToCameraRoll
|
||||||
|
import Photos
|
||||||
|
|
||||||
public func defaultVideoPresetForContext(_ context: AccountContext) -> TGMediaVideoConversionPreset {
|
public func defaultVideoPresetForContext(_ context: AccountContext) -> TGMediaVideoConversionPreset {
|
||||||
var networkType: NetworkType = .wifi
|
var networkType: NetworkType = .wifi
|
||||||
|
@ -14,6 +14,7 @@ import MimeTypes
|
|||||||
import LocalMediaResources
|
import LocalMediaResources
|
||||||
import LegacyUI
|
import LegacyUI
|
||||||
import TextFormat
|
import TextFormat
|
||||||
|
import Photos
|
||||||
|
|
||||||
public func guessMimeTypeByFileExtension(_ ext: String) -> String {
|
public func guessMimeTypeByFileExtension(_ ext: String) -> String {
|
||||||
return TGMimeTypeMap.mimeType(forExtension: ext) ?? "application/binary"
|
return TGMimeTypeMap.mimeType(forExtension: ext) ?? "application/binary"
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import LegacyComponents
|
import LegacyComponents
|
||||||
|
import UIKit
|
||||||
import Display
|
import Display
|
||||||
import Postbox
|
import Postbox
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
@ -13,6 +14,7 @@ import MediaEditor
|
|||||||
import DrawingUI
|
import DrawingUI
|
||||||
import TelegramPresentationData
|
import TelegramPresentationData
|
||||||
import AnimatedCountLabelNode
|
import AnimatedCountLabelNode
|
||||||
|
import CoreMedia
|
||||||
|
|
||||||
protocol LegacyPaintEntity {
|
protocol LegacyPaintEntity {
|
||||||
var position: CGPoint { get }
|
var position: CGPoint { get }
|
||||||
@ -723,17 +725,16 @@ private class SendStarsButtonView: HighlightTrackingButton, TGPhotoSendStarsButt
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Xcode 16
|
#if SWIFT_PACKAGE
|
||||||
#if canImport(ContactProvider)
|
|
||||||
extension SolidRoundedButtonView: @retroactive TGPhotoSolidRoundedButtonView {
|
|
||||||
public func updateWidth(_ width: CGFloat) {
|
|
||||||
let _ = self.updateLayout(width: width, transition: .immediate)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
extension SolidRoundedButtonView: TGPhotoSolidRoundedButtonView {
|
extension SolidRoundedButtonView: TGPhotoSolidRoundedButtonView {
|
||||||
public func updateWidth(_ width: CGFloat) {
|
public func updateWidth(_ width: CGFloat) {
|
||||||
let _ = self.updateLayout(width: width, transition: .immediate)
|
let _ = self.updateLayout(width: width, transition: .immediate)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
extension SolidRoundedButtonView: @retroactive TGPhotoSolidRoundedButtonView {
|
||||||
|
public func updateWidth(_ width: CGFloat) {
|
||||||
|
let _ = self.updateLayout(width: width, transition: .immediate)
|
||||||
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
import UIKit
|
import UIKit
|
||||||
import Display
|
import Display
|
||||||
|
import SSignalKit
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import LegacyComponents
|
import LegacyComponents
|
||||||
@ -8,6 +9,7 @@ import TelegramPresentationData
|
|||||||
import DeviceAccess
|
import DeviceAccess
|
||||||
import AccountContext
|
import AccountContext
|
||||||
import LocalMediaResources
|
import LocalMediaResources
|
||||||
|
import Photos
|
||||||
|
|
||||||
public func legacyWallpaperPicker(context: AccountContext, presentationData: PresentationData, subject: DeviceAccessMediaLibrarySubject = .wallpaper) -> Signal<(LegacyComponentsContext) -> TGMediaAssetsController, Void> {
|
public func legacyWallpaperPicker(context: AccountContext, presentationData: PresentationData, subject: DeviceAccessMediaLibrarySubject = .wallpaper) -> Signal<(LegacyComponentsContext) -> TGMediaAssetsController, Void> {
|
||||||
return Signal { subscriber in
|
return Signal { subscriber in
|
||||||
|
@ -10,6 +10,7 @@ swift_library(
|
|||||||
"-warnings-as-errors",
|
"-warnings-as-errors",
|
||||||
],
|
],
|
||||||
deps = [
|
deps = [
|
||||||
|
"//submodules/SSignalKit/SSignalKit",
|
||||||
"//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit",
|
"//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit",
|
||||||
"//submodules/Postbox:Postbox",
|
"//submodules/Postbox:Postbox",
|
||||||
"//submodules/TelegramCore:TelegramCore",
|
"//submodules/TelegramCore:TelegramCore",
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
import UIKit
|
import UIKit
|
||||||
import Display
|
import Display
|
||||||
|
import SSignalKit
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
import LegacyComponents
|
import LegacyComponents
|
||||||
import TelegramPresentationData
|
import TelegramPresentationData
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
import UIKit
|
import UIKit
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
|
import SSignalKit
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
import MtProtoKit
|
import MtProtoKit
|
||||||
import Display
|
import Display
|
||||||
|
@ -27,6 +27,7 @@ objc_library(
|
|||||||
],
|
],
|
||||||
hdrs = glob([
|
hdrs = glob([
|
||||||
"lottiecpp/PublicHeaders/**/*.h",
|
"lottiecpp/PublicHeaders/**/*.h",
|
||||||
|
"lottiecpp/PublicHeaders/**/*.hpp",
|
||||||
]),
|
]),
|
||||||
includes = [
|
includes = [
|
||||||
"lottiecpp/PublicHeaders",
|
"lottiecpp/PublicHeaders",
|
||||||
|
@ -5,6 +5,7 @@ import Postbox
|
|||||||
import TelegramCore
|
import TelegramCore
|
||||||
import FFMpegBinding
|
import FFMpegBinding
|
||||||
import RangeSet
|
import RangeSet
|
||||||
|
import CoreMedia
|
||||||
|
|
||||||
private func FFMpegLookaheadReader_readPacketCallback(userData: UnsafeMutableRawPointer?, buffer: UnsafeMutablePointer<UInt8>?, bufferSize: Int32) -> Int32 {
|
private func FFMpegLookaheadReader_readPacketCallback(userData: UnsafeMutableRawPointer?, buffer: UnsafeMutablePointer<UInt8>?, bufferSize: Int32) -> Int32 {
|
||||||
let context = Unmanaged<FFMpegLookaheadReader>.fromOpaque(userData!).takeUnretainedValue()
|
let context = Unmanaged<FFMpegLookaheadReader>.fromOpaque(userData!).takeUnretainedValue()
|
||||||
|
@ -4,6 +4,7 @@ import Display
|
|||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
import RangeSet
|
import RangeSet
|
||||||
import TextFormat
|
import TextFormat
|
||||||
|
import UIKit
|
||||||
|
|
||||||
public enum MediaPlayerScrubbingNodeCap {
|
public enum MediaPlayerScrubbingNodeCap {
|
||||||
case square
|
case square
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
|
import UIKit
|
||||||
import Display
|
import Display
|
||||||
|
|
||||||
public enum MediaPlayerTimeTextNodeMode {
|
public enum MediaPlayerTimeTextNodeMode {
|
||||||
|
@ -9,6 +9,7 @@ import SwiftSignalKit
|
|||||||
import Postbox
|
import Postbox
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import FFMpegBinding
|
import FFMpegBinding
|
||||||
|
import CoreMedia
|
||||||
|
|
||||||
private func readPacketCallback(userData: UnsafeMutableRawPointer?, buffer: UnsafeMutablePointer<UInt8>?, bufferSize: Int32) -> Int32 {
|
private func readPacketCallback(userData: UnsafeMutableRawPointer?, buffer: UnsafeMutablePointer<UInt8>?, bufferSize: Int32) -> Int32 {
|
||||||
let context = Unmanaged<UniversalSoftwareVideoSourceImpl>.fromOpaque(userData!).takeUnretainedValue()
|
let context = Unmanaged<UniversalSoftwareVideoSourceImpl>.fromOpaque(userData!).takeUnretainedValue()
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
#import <Foundation/Foundation.h>
|
||||||
#import <EncryptionProvider/EncryptionProvider.h>
|
#import <EncryptionProvider/EncryptionProvider.h>
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
@ -11,6 +11,9 @@ objc_library(
|
|||||||
includes = [
|
includes = [
|
||||||
"Sources",
|
"Sources",
|
||||||
],
|
],
|
||||||
|
copts = [
|
||||||
|
"-Werror",
|
||||||
|
],
|
||||||
visibility = [
|
visibility = [
|
||||||
"//visibility:public",
|
"//visibility:public",
|
||||||
],
|
],
|
||||||
|
@ -127,7 +127,7 @@ static bool ProgressWindowIsLight = true;
|
|||||||
[self dismiss:animated completion:nil];
|
[self dismiss:animated completion:nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)dismiss:(bool)animated completion:(void (^)())completion
|
- (void)dismiss:(bool)animated completion:(void (^)(void))completion
|
||||||
{
|
{
|
||||||
if (animated)
|
if (animated)
|
||||||
{
|
{
|
||||||
|
@ -117,8 +117,6 @@ static void drawSvgPath(CGContextRef context, NSString *path) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool ProxyWindowIsLight = true;
|
|
||||||
|
|
||||||
@interface ProxySpinnerView : UIView
|
@interface ProxySpinnerView : UIView
|
||||||
|
|
||||||
@property (nonatomic, copy) void (^onSuccess)(void);
|
@property (nonatomic, copy) void (^onSuccess)(void);
|
||||||
|
@ -10,6 +10,7 @@ swift_library(
|
|||||||
"-warnings-as-errors",
|
"-warnings-as-errors",
|
||||||
],
|
],
|
||||||
deps = [
|
deps = [
|
||||||
|
"//submodules/SSignalKit/SSignalKit",
|
||||||
"//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit",
|
"//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit",
|
||||||
"//submodules/AsyncDisplayKit:AsyncDisplayKit",
|
"//submodules/AsyncDisplayKit:AsyncDisplayKit",
|
||||||
"//submodules/Display:Display",
|
"//submodules/Display:Display",
|
||||||
|
@ -2,6 +2,7 @@ import Foundation
|
|||||||
import UIKit
|
import UIKit
|
||||||
import LegacyComponents
|
import LegacyComponents
|
||||||
import Display
|
import Display
|
||||||
|
import SSignalKit
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
import Postbox
|
import Postbox
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
|
import UIKit
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import Display
|
import Display
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
|
import UIKit
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import Display
|
import Display
|
||||||
import TelegramPresentationData
|
import TelegramPresentationData
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
|
import UIKit
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import Display
|
import Display
|
||||||
import AnimatedStickerNode
|
import AnimatedStickerNode
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
|
import UIKit
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import Display
|
import Display
|
||||||
import Postbox
|
import Postbox
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
#import <Foundation/Foundation.h>
|
||||||
#import <SSignalKit/SSubscriber.h>
|
#import <SSignalKit/SSubscriber.h>
|
||||||
|
|
||||||
@interface SSignal : NSObject
|
@interface SSignal : NSObject
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
#import <Foundation/Foundation.h>
|
||||||
#import <SSignalKit/SDisposable.h>
|
#import <SSignalKit/SDisposable.h>
|
||||||
|
|
||||||
@interface SSubscriber : NSObject <SDisposable>
|
@interface SSubscriber : NSObject <SDisposable>
|
||||||
|
@ -10,6 +10,7 @@ swift_library(
|
|||||||
"-warnings-as-errors",
|
"-warnings-as-errors",
|
||||||
],
|
],
|
||||||
deps = [
|
deps = [
|
||||||
|
"//submodules/SSignalKit/SSignalKit",
|
||||||
"//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit",
|
"//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit",
|
||||||
"//submodules/Postbox:Postbox",
|
"//submodules/Postbox:Postbox",
|
||||||
"//submodules/TelegramCore:TelegramCore",
|
"//submodules/TelegramCore:TelegramCore",
|
||||||
|
@ -10,6 +10,8 @@ import LocalMediaResources
|
|||||||
import AVFoundation
|
import AVFoundation
|
||||||
import LegacyComponents
|
import LegacyComponents
|
||||||
import ShareItemsImpl
|
import ShareItemsImpl
|
||||||
|
import UIKit
|
||||||
|
import SSignalKit
|
||||||
|
|
||||||
public enum UnpreparedShareItemContent {
|
public enum UnpreparedShareItemContent {
|
||||||
case contact(DeviceContactExtendedData)
|
case contact(DeviceContactExtendedData)
|
||||||
@ -206,6 +208,13 @@ private func preparedShareItem(postbox: Postbox, network: Network, to peerId: Pe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if isGif {
|
if isGif {
|
||||||
|
#if DEBUG
|
||||||
|
let signal = SSignal(generator: { _ in
|
||||||
|
return SBlockDisposable(block: {})
|
||||||
|
})
|
||||||
|
let _ = signal.start(next: nil, error: nil, completed: nil)
|
||||||
|
#endif
|
||||||
|
|
||||||
let convertedData = Signal<(Data, CGSize, Double, Bool), NoError> { subscriber in
|
let convertedData = Signal<(Data, CGSize, Double, Bool), NoError> { subscriber in
|
||||||
let disposable = MetaDisposable()
|
let disposable = MetaDisposable()
|
||||||
let signalDisposable = TGGifConverter.convertGif(toMp4: data).start(next: { next in
|
let signalDisposable = TGGifConverter.convertGif(toMp4: data).start(next: { next in
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
|
import UIKit
|
||||||
import Display
|
import Display
|
||||||
import GenerateStickerPlaceholderImage
|
import GenerateStickerPlaceholderImage
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
|
import UIKit
|
||||||
import Display
|
import Display
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
|
import UIKit
|
||||||
import Display
|
import Display
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import ComponentFlow
|
import ComponentFlow
|
||||||
|
1
submodules/Stripe/BUILD
vendored
1
submodules/Stripe/BUILD
vendored
@ -15,6 +15,7 @@ objc_library(
|
|||||||
],
|
],
|
||||||
copts = [
|
copts = [
|
||||||
"-I{}/PublicHeaders/Stripe".format(package_name()),
|
"-I{}/PublicHeaders/Stripe".format(package_name()),
|
||||||
|
"-Werror",
|
||||||
],
|
],
|
||||||
sdk_frameworks = [
|
sdk_frameworks = [
|
||||||
"Foundation",
|
"Foundation",
|
||||||
|
@ -123,8 +123,6 @@ static NSString *const STPSDKVersion = @"9.1.0";
|
|||||||
*/
|
*/
|
||||||
+ (BOOL)canSubmitPaymentRequest:(PKPaymentRequest *)paymentRequest NS_AVAILABLE_IOS(8_0);
|
+ (BOOL)canSubmitPaymentRequest:(PKPaymentRequest *)paymentRequest NS_AVAILABLE_IOS(8_0);
|
||||||
|
|
||||||
+ (BOOL)deviceSupportsApplePay;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A convenience method to return a `PKPaymentRequest` with sane default values. You will still need to configure the `paymentSummaryItems` property to indicate
|
* A convenience method to return a `PKPaymentRequest` with sane default values. You will still need to configure the `paymentSummaryItems` property to indicate
|
||||||
*what the user is purchasing, as well as the optional `requiredShippingAddressFields`, `requiredBillingAddressFields`, and `shippingMethods` properties to indicate
|
*what the user is purchasing, as well as the optional `requiredShippingAddressFields`, `requiredBillingAddressFields`, and `shippingMethods` properties to indicate
|
||||||
@ -201,8 +199,6 @@ typedef void (^STPCompletionBlock)(STPToken * __nullable token, NSError * __null
|
|||||||
publishableKey:(NSString *)publishableKey
|
publishableKey:(NSString *)publishableKey
|
||||||
completion:(nullable STPCompletionBlock)handler __attribute__((deprecated));
|
completion:(nullable STPCompletionBlock)handler __attribute__((deprecated));
|
||||||
|
|
||||||
+ (BOOL)deviceSupportsApplePay;
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_END
|
NS_ASSUME_NONNULL_END
|
||||||
|
@ -242,9 +242,6 @@ static NSString *const stripeAPIVersion = @"2015-10-12";
|
|||||||
@implementation Stripe (ApplePay)
|
@implementation Stripe (ApplePay)
|
||||||
|
|
||||||
+ (BOOL)canSubmitPaymentRequest:(PKPaymentRequest *)paymentRequest {
|
+ (BOOL)canSubmitPaymentRequest:(PKPaymentRequest *)paymentRequest {
|
||||||
if (![self deviceSupportsApplePay]) {
|
|
||||||
return NO;
|
|
||||||
}
|
|
||||||
if (paymentRequest == nil) {
|
if (paymentRequest == nil) {
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
@ -256,16 +253,10 @@ static NSString *const stripeAPIVersion = @"2015-10-12";
|
|||||||
|
|
||||||
+ (NSArray<NSString *> *)supportedPKPaymentNetworks {
|
+ (NSArray<NSString *> *)supportedPKPaymentNetworks {
|
||||||
NSArray *supportedNetworks = @[PKPaymentNetworkAmex, PKPaymentNetworkMasterCard, PKPaymentNetworkVisa];
|
NSArray *supportedNetworks = @[PKPaymentNetworkAmex, PKPaymentNetworkMasterCard, PKPaymentNetworkVisa];
|
||||||
if ((&PKPaymentNetworkDiscover) != NULL) {
|
supportedNetworks = [supportedNetworks arrayByAddingObject:PKPaymentNetworkDiscover];
|
||||||
supportedNetworks = [supportedNetworks arrayByAddingObject:PKPaymentNetworkDiscover];
|
|
||||||
}
|
|
||||||
return supportedNetworks;
|
return supportedNetworks;
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (BOOL)deviceSupportsApplePay {
|
|
||||||
return [PKPaymentAuthorizationViewController class] && [PKPaymentAuthorizationViewController canMakePaymentsUsingNetworks:[self supportedPKPaymentNetworks]];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (PKPaymentRequest *)paymentRequestWithMerchantIdentifier:(NSString *)merchantIdentifier {
|
+ (PKPaymentRequest *)paymentRequestWithMerchantIdentifier:(NSString *)merchantIdentifier {
|
||||||
if (![PKPaymentRequest class]) {
|
if (![PKPaymentRequest class]) {
|
||||||
return nil;
|
return nil;
|
||||||
|
@ -51,7 +51,6 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
* An icon representing Visa.
|
* An icon representing Visa.
|
||||||
*/
|
*/
|
||||||
+ (UIImage *)visaCardImage;
|
+ (UIImage *)visaCardImage;
|
||||||
+ (UIImage *)otherCardImage;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An icon to use when the type of the card is unknown.
|
* An icon to use when the type of the card is unknown.
|
||||||
|
@ -50,8 +50,7 @@
|
|||||||
|
|
||||||
- (BOOL)applePayEnabled {
|
- (BOOL)applePayEnabled {
|
||||||
return self.appleMerchantIdentifier &&
|
return self.appleMerchantIdentifier &&
|
||||||
(self.additionalPaymentMethods & STPPaymentMethodTypeApplePay) &&
|
(self.additionalPaymentMethods & STPPaymentMethodTypeApplePay);
|
||||||
[Stripe deviceSupportsApplePay];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
@ -22,6 +22,13 @@
|
|||||||
|
|
||||||
@implementation STPToken
|
@implementation STPToken
|
||||||
|
|
||||||
|
- (instancetype)init {
|
||||||
|
self = [super init];
|
||||||
|
if (self) {
|
||||||
|
}
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
- (NSString *)description {
|
- (NSString *)description {
|
||||||
return self.tokenId ?: @"Unknown token";
|
return self.tokenId ?: @"Unknown token";
|
||||||
}
|
}
|
||||||
|
@ -53,6 +53,7 @@ swift_library(
|
|||||||
":TelegramCallsUIBundle",
|
":TelegramCallsUIBundle",
|
||||||
],
|
],
|
||||||
deps = [
|
deps = [
|
||||||
|
"//submodules/SSignalKit/SSignalKit",
|
||||||
"//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit",
|
"//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit",
|
||||||
"//submodules/Display:Display",
|
"//submodules/Display:Display",
|
||||||
"//submodules/TelegramPresentationData:TelegramPresentationData",
|
"//submodules/TelegramPresentationData:TelegramPresentationData",
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
|
import UIKit
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import Display
|
import Display
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
|
@ -19,6 +19,7 @@ import AlertComponent
|
|||||||
import TelegramPresentationData
|
import TelegramPresentationData
|
||||||
import ComponentFlow
|
import ComponentFlow
|
||||||
import MultilineTextComponent
|
import MultilineTextComponent
|
||||||
|
import AVFoundation
|
||||||
|
|
||||||
private func resolvedEmojiKey(data: Data) -> [String] {
|
private func resolvedEmojiKey(data: Data) -> [String] {
|
||||||
let resolvedKey = stringForEmojiHashOfData(data, 4) ?? []
|
let resolvedKey = stringForEmojiHashOfData(data, 4) ?? []
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
import UIKit
|
import UIKit
|
||||||
import Display
|
import Display
|
||||||
|
import SSignalKit
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
import AccountContext
|
import AccountContext
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
@ -12,6 +13,7 @@ import WebSearchUI
|
|||||||
import MapResourceToAvatarSizes
|
import MapResourceToAvatarSizes
|
||||||
import LegacyUI
|
import LegacyUI
|
||||||
import LegacyMediaPickerUI
|
import LegacyMediaPickerUI
|
||||||
|
import AVFoundation
|
||||||
|
|
||||||
extension VideoChatScreenComponent.View {
|
extension VideoChatScreenComponent.View {
|
||||||
func openParticipantContextMenu(id: EnginePeer.Id, sourceView: ContextExtractedContentContainingView, gesture: ContextGesture?) {
|
func openParticipantContextMenu(id: EnginePeer.Id, sourceView: ContextExtractedContentContainingView, gesture: ContextGesture?) {
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
|
import UIKit
|
||||||
import Display
|
import Display
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import Postbox
|
import Postbox
|
||||||
|
@ -10,6 +10,7 @@ swift_library(
|
|||||||
"-warnings-as-errors",
|
"-warnings-as-errors",
|
||||||
],
|
],
|
||||||
deps = [
|
deps = [
|
||||||
|
"//submodules/SSignalKit/SSignalKit",
|
||||||
"//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit",
|
"//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit",
|
||||||
"//submodules/AsyncDisplayKit:AsyncDisplayKit",
|
"//submodules/AsyncDisplayKit:AsyncDisplayKit",
|
||||||
"//submodules/LegacyComponents",
|
"//submodules/LegacyComponents",
|
||||||
|
@ -4,6 +4,7 @@ import LegacyComponents
|
|||||||
import Display
|
import Display
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import Postbox
|
import Postbox
|
||||||
|
import SSignalKit
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
import AccountContext
|
import AccountContext
|
||||||
import ShareController
|
import ShareController
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
import Foundation
|
||||||
|
import UIKit
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import Display
|
import Display
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import UIKit
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import Display
|
import Display
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
|
import UIKit
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import Display
|
import Display
|
||||||
import ComponentFlow
|
import ComponentFlow
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
|
import UIKit
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import Display
|
import Display
|
||||||
import ComponentFlow
|
import ComponentFlow
|
||||||
|
@ -2,6 +2,7 @@ import SwiftSignalKit
|
|||||||
import Postbox
|
import Postbox
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
|
import UIKit
|
||||||
import Display
|
import Display
|
||||||
import TelegramPresentationData
|
import TelegramPresentationData
|
||||||
|
|
||||||
|
@ -103,6 +103,7 @@ swift_library(
|
|||||||
"//submodules/StickerResources",
|
"//submodules/StickerResources",
|
||||||
"//submodules/TelegramUI/Components/StorageUsageScreen",
|
"//submodules/TelegramUI/Components/StorageUsageScreen",
|
||||||
"//submodules/TelegramUI/Components/Stories/StoryContainerScreen",
|
"//submodules/TelegramUI/Components/Stories/StoryContainerScreen",
|
||||||
|
"//submodules/SSignalKit/SSignalKit",
|
||||||
"//submodules/SSignalKit/SwiftSignalKit",
|
"//submodules/SSignalKit/SwiftSignalKit",
|
||||||
"//submodules/TelegramBaseController",
|
"//submodules/TelegramBaseController",
|
||||||
"//submodules/TelegramCallsUI",
|
"//submodules/TelegramCallsUI",
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
import Foundation
|
||||||
|
import UIKit
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import Display
|
import Display
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
import Foundation
|
||||||
|
import UIKit
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import Display
|
import Display
|
||||||
import TelegramPresentationData
|
import TelegramPresentationData
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
import Foundation
|
||||||
|
import UIKit
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import Display
|
import Display
|
||||||
import TelegramPresentationData
|
import TelegramPresentationData
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
import Foundation
|
||||||
|
import UIKit
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import Display
|
import Display
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
import Foundation
|
||||||
|
import UIKit
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import Display
|
import Display
|
||||||
import TelegramPresentationData
|
import TelegramPresentationData
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
import Foundation
|
||||||
|
import UIKit
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import Display
|
import Display
|
||||||
import TelegramPresentationData
|
import TelegramPresentationData
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
import Foundation
|
||||||
|
import UIKit
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import Display
|
import Display
|
||||||
import TelegramPresentationData
|
import TelegramPresentationData
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
|
import UIKit
|
||||||
import Display
|
import Display
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
import Foundation
|
||||||
|
import UIKit
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import Display
|
import Display
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import UIKit
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import Display
|
import Display
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
import Foundation
|
||||||
|
import UIKit
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import Display
|
import Display
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
import Foundation
|
||||||
|
import UIKit
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import Display
|
import Display
|
||||||
import ComponentFlow
|
import ComponentFlow
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
import UIKit
|
import UIKit
|
||||||
import Display
|
import Display
|
||||||
|
import SSignalKit
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import AccountContext
|
import AccountContext
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
import Foundation
|
||||||
|
import UIKit
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import Display
|
import Display
|
||||||
import TelegramPresentationData
|
import TelegramPresentationData
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
|
import UIKit
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import Display
|
import Display
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
|
import UIKit
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import Display
|
import Display
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
|
import UIKit
|
||||||
import Display
|
import Display
|
||||||
import ComponentFlow
|
import ComponentFlow
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import AVFoundation
|
import AVFoundation
|
||||||
|
import UIKit
|
||||||
import Display
|
import Display
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import AVFoundation
|
import AVFoundation
|
||||||
|
import UIKit
|
||||||
import Display
|
import Display
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
|
@ -15,8 +15,8 @@ import ChatListSearchItemHeader
|
|||||||
import ContactsPeerItem
|
import ContactsPeerItem
|
||||||
|
|
||||||
//Xcode 16
|
//Xcode 16
|
||||||
#if canImport(ContactProvider)
|
#if SWIFT_PACKAGE
|
||||||
extension NavigationBarSearchContentNode: @retroactive ItemListControllerSearchNavigationContentNode {
|
extension NavigationBarSearchContentNode: ItemListControllerSearchNavigationContentNode {
|
||||||
public func activate() {
|
public func activate() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -27,7 +27,7 @@ extension NavigationBarSearchContentNode: @retroactive ItemListControllerSearchN
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
extension NavigationBarSearchContentNode: ItemListControllerSearchNavigationContentNode {
|
extension NavigationBarSearchContentNode: @retroactive ItemListControllerSearchNavigationContentNode {
|
||||||
public func activate() {
|
public func activate() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@ swift_library(
|
|||||||
],
|
],
|
||||||
deps = [
|
deps = [
|
||||||
"//submodules/Postbox",
|
"//submodules/Postbox",
|
||||||
|
"//submodules/SSignalKit/SSignalKit",
|
||||||
"//submodules/SSignalKit/SwiftSignalKit",
|
"//submodules/SSignalKit/SwiftSignalKit",
|
||||||
"//submodules/TelegramCore",
|
"//submodules/TelegramCore",
|
||||||
"//submodules/LegacyComponents",
|
"//submodules/LegacyComponents",
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
import UIKit
|
import UIKit
|
||||||
import Postbox
|
import Postbox
|
||||||
|
import SSignalKit
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import LegacyComponents
|
import LegacyComponents
|
||||||
@ -785,7 +786,7 @@ public func fetchLocalFileGifMediaResource(resource: LocalFileGifMediaResource)
|
|||||||
|
|
||||||
let disposable = MetaDisposable()
|
let disposable = MetaDisposable()
|
||||||
if let data = try? Data(contentsOf: URL(fileURLWithPath: resource.path), options: Data.ReadingOptions.mappedIfSafe) {
|
if let data = try? Data(contentsOf: URL(fileURLWithPath: resource.path), options: Data.ReadingOptions.mappedIfSafe) {
|
||||||
let signal = TGGifConverter.convertGif(toMp4: data)!
|
let signal = TGGifConverter.convertGif(toMp4: data)
|
||||||
let signalDisposable = signal.start(next: { next in
|
let signalDisposable = signal.start(next: { next in
|
||||||
if let result = next as? NSDictionary, let path = result["path"] as? String {
|
if let result = next as? NSDictionary, let path = result["path"] as? String {
|
||||||
var value = stat()
|
var value = stat()
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
|
import UIKit
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import Display
|
import Display
|
||||||
import ComponentFlow
|
import ComponentFlow
|
||||||
|
@ -16,6 +16,7 @@ import HexColor
|
|||||||
import PresentationDataUtils
|
import PresentationDataUtils
|
||||||
import MediaPickerUI
|
import MediaPickerUI
|
||||||
import WallpaperGalleryScreen
|
import WallpaperGalleryScreen
|
||||||
|
import Photos
|
||||||
|
|
||||||
public enum WallpaperSelectionResult {
|
public enum WallpaperSelectionResult {
|
||||||
case remove
|
case remove
|
||||||
|
@ -15,6 +15,7 @@ import ICloudResources
|
|||||||
import FetchVideoMediaResource
|
import FetchVideoMediaResource
|
||||||
import FetchAudioMediaResource
|
import FetchAudioMediaResource
|
||||||
import Display
|
import Display
|
||||||
|
import UIKit
|
||||||
|
|
||||||
public func makeTelegramAccountAuxiliaryMethods(uploadInBackground: ((Postbox, MediaResource) -> Signal<String?, NoError>)?) -> AccountAuxiliaryMethods {
|
public func makeTelegramAccountAuxiliaryMethods(uploadInBackground: ((Postbox, MediaResource) -> Signal<String?, NoError>)?) -> AccountAuxiliaryMethods {
|
||||||
return AccountAuxiliaryMethods(fetchResource: { postbox, resource, ranges, _ in
|
return AccountAuxiliaryMethods(fetchResource: { postbox, resource, ranges, _ in
|
||||||
|
@ -4,6 +4,7 @@ import SwiftSignalKit
|
|||||||
import UniversalMediaPlayer
|
import UniversalMediaPlayer
|
||||||
import Postbox
|
import Postbox
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
|
import UIKit
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import AccountContext
|
import AccountContext
|
||||||
import TelegramAudio
|
import TelegramAudio
|
||||||
|
@ -11,6 +11,8 @@ import UniversalMediaPlayer
|
|||||||
import AccountContext
|
import AccountContext
|
||||||
import PhotoResources
|
import PhotoResources
|
||||||
import RangeSet
|
import RangeSet
|
||||||
|
import CoreMedia
|
||||||
|
import AVFoundation
|
||||||
|
|
||||||
public final class SystemVideoContent: UniversalVideoContent {
|
public final class SystemVideoContent: UniversalVideoContent {
|
||||||
public let id: AnyHashable
|
public let id: AnyHashable
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user