mirror of
https://github.com/ichmagmaus111/ghostgram.git
synced 2026-08-23 14:22:30 +02:00
Update Ghostgram features
This commit is contained in:
+3
-1
@@ -76,6 +76,8 @@ private func loadCountryCodes() -> [Country] {
|
||||
|
||||
private var countryCodes: [Country] = loadCountryCodes()
|
||||
private var countryCodesByPrefix: [String: (Country, Country.CountryCode)] = [:]
|
||||
// MARK: Swiftgram
|
||||
private var sgCountryCodesByPrefix: [String: (Country, Country.CountryCode)] = ["999": (Country(id: "XX", name: "Demo", localizedName: nil, countryCodes: [Country.CountryCode(code: "999", prefixes: [], patterns: ["XX X XXXX"])], hidden: false), Country.CountryCode(code: "999", prefixes: [], patterns: ["XX X XXXX"]))]
|
||||
|
||||
public func loadServerCountryCodes(accountManager: AccountManager<TelegramAccountManagerTypes>, engine: TelegramEngineUnauthorized, completion: @escaping () -> Void) {
|
||||
let _ = (engine.localization.getCountriesList(accountManager: accountManager, langCode: nil)
|
||||
@@ -235,7 +237,7 @@ public final class AuthorizationSequenceCountrySelectionController: ViewControll
|
||||
|
||||
for i in 0..<number.count {
|
||||
let prefix = String(number.prefix(number.count - i))
|
||||
if let country = countryCodesByPrefix[prefix] {
|
||||
if let country = countryCodesByPrefix[prefix] ?? sgCountryCodesByPrefix[prefix] {
|
||||
if var currentResults = results {
|
||||
if let result = currentResults.first, result.1.code.count > country.1.code.count {
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user