mirror of
https://github.com/TelegramMessenger/Telegram-iOS.git
synced 2026-07-06 03:33:41 +02:00
Vendor the standalone tgwatch watch-app sources into Telegram/WatchApp/ as a tracked snapshot and build it from there by default (tracked Bazel inputs). Make.py drives embedding via --embedWatchApp (--watchAppSourcePath removed); the filegroup excludes .swiftpm/.build. Documented in CLAUDE.md. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
22 lines
780 B
Swift
22 lines
780 B
Swift
import Foundation
|
|
|
|
enum ConfigError: Equatable, Swift.Error {
|
|
case missingApiId
|
|
case missingApiHash
|
|
case placeholderApiHash
|
|
|
|
var humanMessage: String {
|
|
switch self {
|
|
case .missingApiId, .missingApiHash, .placeholderApiHash:
|
|
return "Missing API credentials. Copy Config/Secrets.example.xcconfig to Config/Secrets.xcconfig and fill in your values."
|
|
}
|
|
}
|
|
}
|
|
|
|
func validateSecrets(apiId: Int, apiHash: String) -> Result<Void, ConfigError> {
|
|
if apiId <= 0 { return .failure(.missingApiId) }
|
|
let trimmed = apiHash.trimmingCharacters(in: .whitespaces)
|
|
if trimmed.isEmpty { return .failure(.missingApiHash) }
|
|
if trimmed == "replace_with_32_hex_chars" { return .failure(.placeholderApiHash) }
|
|
return .success(())
|
|
}
|