Skip to content

Commit 9ca6353

Browse files
Hide auto MTProxy servers and default to Auto
Keep the fetched pool off the saved-proxy list and settings rows. Connection type shows Auto. New accounts and existing 3850/3851 prefs migrate on by default; turning the toggle off still sticks. Co-authored-by: D3C0Y <decoder-dev@users.noreply.github.com>
1 parent 4fc69c3 commit 9ca6353

7 files changed

Lines changed: 47 additions & 35 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44
Тег релиза = `v{app}-{tagSuffix}` (например `v12.9.2-3845`); CI кладёт секцию тега в GitHub Release notes.
55
Теги `*-pre` публикуются как GitHub **pre-release** (не Latest).
66

7+
## [v12.9.2-3852-pre] — 2026-08-18
8+
9+
Pre-release: авто-прокси без показа серверов в списке. Sideload smoke, не Latest.
10+
11+
### Changed
12+
- **Авто MTProxy** по умолчанию включён. Подобранные серверы не попадают в «Сохранённые прокси» и не светятся в настройках — в типе соединения просто «Авто». Свои вручную добавленные прокси по-прежнему видны.
13+
714
## [v12.9.2-3851-pre] — 2026-08-18
815

916
Pre-release: фикс повторного включения Авто MTProxy + быстрее выбор прокси. Sideload smoke, не Latest.

‎submodules/SettingsUI/Sources/Data and Storage/DataAndStorageSettingsController.swift‎

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -647,12 +647,18 @@ private func dataAndStorageControllerEntries(context: AccountContext, state: Dat
647647
}
648648

649649
let proxyValue: String
650-
if let proxySettings = data.proxySettings, let activeServer = proxySettings.activeServer, proxySettings.enabled {
651-
switch activeServer.connection {
652-
case .socks5:
653-
proxyValue = presentationData.strings.ChatSettings_ConnectionType_UseSocks5
654-
case .mtp:
655-
proxyValue = presentationData.strings.SocksProxySetup_ProxyTelegram
650+
if let proxySettings = data.proxySettings, proxySettings.enabled {
651+
if proxySettings.autoFetchPublicMtProxy {
652+
proxyValue = Locale.preferredLanguages.first?.hasPrefix("ru") == true ? "Авто" : "Auto"
653+
} else if let activeServer = proxySettings.activeServer {
654+
switch activeServer.connection {
655+
case .socks5:
656+
proxyValue = presentationData.strings.ChatSettings_ConnectionType_UseSocks5
657+
case .mtp:
658+
proxyValue = presentationData.strings.SocksProxySetup_ProxyTelegram
659+
}
660+
} else {
661+
proxyValue = presentationData.strings.GroupInfo_SharedMediaNone
656662
}
657663
} else {
658664
proxyValue = presentationData.strings.GroupInfo_SharedMediaNone

‎submodules/SettingsUI/Sources/Data and Storage/ProxyListSettingsController.swift‎

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -378,14 +378,14 @@ private enum ProxySettingsControllerEntry: ItemListNodeEntry {
378378
private func proxySettingsControllerEntries(theme: PresentationTheme, strings: PresentationStrings, state: ProxySettingsControllerState, proxySettings: ProxySettings, statuses: [ProxyServerSettings: ProxyServerStatus], connectionStatus: ConnectionStatus) -> [ProxySettingsControllerEntry] {
379379
var entries: [ProxySettingsControllerEntry] = []
380380

381-
entries.append(.enabled(theme, strings.ChatSettings_ConnectionType_UseProxy, proxySettings.enabled, proxySettings.servers.isEmpty))
381+
entries.append(.enabled(theme, strings.ChatSettings_ConnectionType_UseProxy, proxySettings.enabled, proxySettings.servers.isEmpty && !proxySettings.autoFetchPublicMtProxy))
382382
entries.append(.serversHeader(theme, strings.SocksProxySetup_SavedProxies))
383383
entries.append(.addServer(theme, strings.SocksProxySetup_AddProxy, state.editing))
384384
var index = 0
385385
var existingServers = Set<ProxyServerSettings>()
386386
let automatic = Set(proxySettings.automaticServers)
387387
for server in proxySettings.servers {
388-
if automatic.contains(server), server != proxySettings.activeServer {
388+
if automatic.contains(server) {
389389
continue
390390
}
391391
if !existingServers.insert(server).inserted {
@@ -449,14 +449,14 @@ private func proxySettingsControllerEntries(theme: PresentationTheme, strings: P
449449
autoRotateTitle = "Автосмена прокси"
450450
autoRotateInfo = "При проблемах с соединением переключаться на следующий сохранённый прокси."
451451
autoFetchTitle = "Авто MTProxy"
452-
autoFetchInfo = "Скачивать публичные списки MTProxy (SoliSpirit и kort0881), мерить задержку и переключаться на самый быстрый живой. Это чужие серверы: они не читают чаты, но видят ваш IP. Свои прокси не удаляются."
452+
autoFetchInfo = "Сам скачивает публичные списки и держит соединение на самом быстром живом MTProxy. В списке сохранённых авто-серверы не показываются. Чужие ноды не читают чаты, но видят IP."
453453
} else {
454454
useLocalDNSTitle = "Local DNS for Proxy"
455455
useLocalDNSInfo = "Resolve proxy hostnames via system DNS instead of Google DoH (avoids DoH timeouts)."
456456
autoRotateTitle = "Auto-rotate Proxies"
457457
autoRotateInfo = "When the active proxy has connection issues, switch to the next saved proxy."
458458
autoFetchTitle = "Auto MTProxy"
459-
autoFetchInfo = "Download public MTProxy lists (SoliSpirit and kort0881), probe latency, and fail over to the fastest live server. These are third-party nodes: they cannot read chats, but they see your IP. Manually added proxies are kept."
459+
autoFetchInfo = "Automatically downloads public lists and keeps the connection on the fastest live MTProxy. Auto servers are not shown in the saved list. Third-party nodes cannot read chats, but they see your IP."
460460
}
461461
entries.append(.useLocalDNS(theme, useLocalDNSTitle, proxySettings.useLocalDNSForProxyHosts))
462462
entries.append(.useLocalDNSInfo(theme, useLocalDNSInfo))
@@ -601,9 +601,7 @@ public func proxySettingsController(accountManager: AccountManager<TelegramAccou
601601

602602
let statusesContext = ProxyServersStatuses(network: network, servers: proxySettings.get()
603603
|> map { proxySettings -> [ProxyServerSettings] in
604-
return proxySettings.servers.filter { server in
605-
!proxySettings.automaticServers.contains(server) || server == proxySettings.activeServer
606-
}
604+
return proxySettings.servers.filter { !proxySettings.automaticServers.contains($0) }
607605
})
608606

609607
let signal = combineLatest(updatedPresentationData, statePromise.get(), proxySettings.get(), statusesContext.statuses(), network.connectionStatus)
@@ -716,7 +714,7 @@ public func proxySettingsController(accountManager: AccountManager<TelegramAccou
716714
|> deliverOnMainQueue).start(next: { settings in
717715
var result = ""
718716
for server in settings.servers {
719-
if settings.automaticServers.contains(server), server != settings.activeServer {
717+
if settings.automaticServers.contains(server) {
720718
continue
721719
}
722720
if !result.isEmpty {

‎submodules/SettingsUI/Sources/ForkExtrasController.swift‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ private enum ForkExtrasLocalizedString {
130130
"ForkExtras.LocalPremium": "Local Telegram Premium",
131131
"ForkExtras.LocalPremiumFooter": "Unlock client-side Premium UX on this device: Story Stealth Mode, HD stories, sticker/emoji cosmetics. Does not buy real Premium or change your badge for others.",
132132
"ForkExtras.AutoFetchMtProxy": "Auto MTProxy",
133-
"ForkExtras.AutoFetchMtProxyFooter": "Download public MTProxy lists (SoliSpirit and kort0881), probe latency, and fail over to the fastest live server. Third-party nodes cannot read chats, but they see your IP. Manually added proxies are kept.",
133+
"ForkExtras.AutoFetchMtProxyFooter": "Keeps Telegram on the fastest live public MTProxy automatically. Auto servers stay hidden from the saved list. Third-party nodes cannot read chats, but they see your IP.",
134134
"ForkExtras.HideAds": "Hide Ads",
135135
"ForkExtras.HideAdsFooter": "Sponsored and recommended messages are permanently disabled in this build.",
136136
"ForkExtras.HideBlockedMessages": "Hide Blocked Users",
@@ -226,7 +226,7 @@ private enum ForkExtrasLocalizedString {
226226
"ForkExtras.LocalPremium": "Локальный Telegram Premium",
227227
"ForkExtras.LocalPremiumFooter": "Клиентские функции Premium на этом устройстве: stealth историй, HD, косметика стикеров/эмодзи. Не покупает Premium и не меняет ваш значок для других.",
228228
"ForkExtras.AutoFetchMtProxy": "Авто MTProxy",
229-
"ForkExtras.AutoFetchMtProxyFooter": "Скачивать публичные списки MTProxy (SoliSpirit и kort0881), мерить задержку и переключаться на самый быстрый живой. Чужие серверы не читают чаты, но видят ваш IP. Свои прокси не удаляются.",
229+
"ForkExtras.AutoFetchMtProxyFooter": "Сам держит соединение на самом быстром живом публичном MTProxy. Авто-серверы в списке сохранённых не показываются. Чужие ноды не читают чаты, но видят IP.",
230230
"ForkExtras.HideAds": "Скрыть рекламу",
231231
"ForkExtras.HideAdsFooter": "Спонсорские и рекомендованные сообщения в этой сборке отключены навсегда.",
232232
"ForkExtras.HideBlockedMessages": "Скрыть заблокированных",

‎submodules/TelegramCore/Sources/State/ManagedAutomaticMtProxy.swift‎

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ private final class AutomaticMtProxyContext {
222222
private var excludedActiveServer: ProxyServerSettings?
223223
private var lastStoredAutomaticServers: [ProxyServerSettings] = []
224224
private var cachedFetchedServers: [ProxyServerSettings] = []
225+
private var didReceiveSettings = false
225226

226227
init(accountManager: AccountManager<TelegramAccountManagerTypes>, network: Network) {
227228
self.accountManager = accountManager
@@ -239,6 +240,8 @@ private final class AutomaticMtProxyContext {
239240
guard let self else {
240241
return
241242
}
243+
let isInitial = !self.didReceiveSettings
244+
self.didReceiveSettings = true
242245
let wasEnabled = self.currentSettings.autoFetchPublicMtProxy
243246
self.currentSettings = settings
244247
if settings.autoFetchPublicMtProxy {
@@ -255,7 +258,7 @@ private final class AutomaticMtProxyContext {
255258
}
256259
let probe = Array(probeSource.prefix(automaticMtProxyProbeLimit))
257260
self.candidateServers.set(.single(probe))
258-
if !wasEnabled {
261+
if isInitial || !wasEnabled {
259262
self.restartAutoFetch(with: probe)
260263
}
261264
} else {
@@ -367,17 +370,9 @@ private final class AutomaticMtProxyContext {
367370
let manualSet = Set(manual)
368371
let newAutomatic = fetched.filter { !manualSet.contains($0) }
369372
settings.automaticServers = newAutomatic
370-
let visibleAuto: ProxyServerSettings?
371-
if let active = settings.activeServer, newAutomatic.contains(active) {
372-
visibleAuto = active
373-
} else {
374-
visibleAuto = newAutomatic.first
375-
settings.activeServer = visibleAuto
376-
}
377-
if let visibleAuto {
378-
settings.servers = [visibleAuto] + manual.filter { $0 != visibleAuto }
379-
} else {
380-
settings.servers = manual
373+
settings.servers = manual
374+
if settings.activeServer == nil || !(settings.activeServer.map(newAutomatic.contains) ?? false) {
375+
settings.activeServer = newAutomatic.first
381376
}
382377
settings.enabled = true
383378
return settings
@@ -490,11 +485,10 @@ private final class AutomaticMtProxyContext {
490485
return settings
491486
}
492487
let automatic = Set(settings.automaticServers)
493-
let manual = settings.servers.filter { !automatic.contains($0) && $0 != best }
488+
settings.servers = settings.servers.filter { !automatic.contains($0) && $0 != best }
494489
if !settings.automaticServers.contains(best) {
495490
settings.automaticServers.insert(best, at: 0)
496491
}
497-
settings.servers = [best] + manual
498492
settings.activeServer = best
499493
settings.enabled = true
500494
return settings

‎submodules/TelegramCore/Sources/SyncCore/SyncCore_ProxySettings.swift‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,10 @@ public struct ProxySettings: Codable, Equatable {
8686
public var automaticServers: [ProxyServerSettings]
8787

8888
public static var defaultSettings: ProxySettings {
89-
return ProxySettings(enabled: false, servers: [], activeServer: nil, useForCalls: false, useLocalDNSForProxyHosts: false, autoRotateProxies: false, autoFetchPublicMtProxy: false, automaticServers: [])
89+
return ProxySettings(enabled: false, servers: [], activeServer: nil, useForCalls: false, useLocalDNSForProxyHosts: false, autoRotateProxies: false, autoFetchPublicMtProxy: true, automaticServers: [])
9090
}
9191

92-
public init(enabled: Bool, servers: [ProxyServerSettings], activeServer: ProxyServerSettings?, useForCalls: Bool, useLocalDNSForProxyHosts: Bool = false, autoRotateProxies: Bool = false, autoFetchPublicMtProxy: Bool = false, automaticServers: [ProxyServerSettings] = []) {
92+
public init(enabled: Bool, servers: [ProxyServerSettings], activeServer: ProxyServerSettings?, useForCalls: Bool, useLocalDNSForProxyHosts: Bool = false, autoRotateProxies: Bool = false, autoFetchPublicMtProxy: Bool = true, automaticServers: [ProxyServerSettings] = []) {
9393
self.enabled = enabled
9494
self.servers = servers
9595
self.activeServer = activeServer
@@ -109,7 +109,11 @@ public struct ProxySettings: Codable, Equatable {
109109
self.useForCalls = ((try? container.decode(Int32.self, forKey: "useForCalls")) ?? 0) != 0
110110
self.useLocalDNSForProxyHosts = ((try? container.decode(Int32.self, forKey: "useLocalDNSForProxyHosts")) ?? 0) != 0
111111
self.autoRotateProxies = ((try? container.decode(Int32.self, forKey: "autoRotateProxies")) ?? 0) != 0
112-
self.autoFetchPublicMtProxy = ((try? container.decode(Int32.self, forKey: "autoFetchPublicMtProxy")) ?? 0) != 0
112+
if let stored = try? container.decode(Int32.self, forKey: "autoFetchMtProxy") {
113+
self.autoFetchPublicMtProxy = stored != 0
114+
} else {
115+
self.autoFetchPublicMtProxy = true
116+
}
113117
self.automaticServers = (try? container.decode([ProxyServerSettings].self, forKey: "automaticServers")) ?? []
114118
}
115119

@@ -123,6 +127,7 @@ public struct ProxySettings: Codable, Equatable {
123127
try container.encode((self.useLocalDNSForProxyHosts ? 1 : 0) as Int32, forKey: "useLocalDNSForProxyHosts")
124128
try container.encode((self.autoRotateProxies ? 1 : 0) as Int32, forKey: "autoRotateProxies")
125129
try container.encode((self.autoFetchPublicMtProxy ? 1 : 0) as Int32, forKey: "autoFetchPublicMtProxy")
130+
try container.encode((self.autoFetchPublicMtProxy ? 1 : 0) as Int32, forKey: "autoFetchMtProxy")
126131
try container.encode(self.automaticServers, forKey: "automaticServers")
127132
}
128133

‎submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoSettingsItems.swift‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,11 @@ func settingsItems(data: PeerInfoScreenData?, context: AccountContext, presentat
151151
interaction.openSettings(.profile)
152152
}))
153153

154-
if !settings.proxySettings.servers.isEmpty {
154+
if !settings.proxySettings.servers.isEmpty || settings.proxySettings.autoFetchPublicMtProxy {
155155
let proxyType: String
156-
if settings.proxySettings.enabled, let activeServer = settings.proxySettings.activeServer {
156+
if settings.proxySettings.autoFetchPublicMtProxy, settings.proxySettings.enabled {
157+
proxyType = Locale.preferredLanguages.first?.hasPrefix("ru") == true ? "Авто" : "Auto"
158+
} else if settings.proxySettings.enabled, let activeServer = settings.proxySettings.activeServer {
157159
switch activeServer.connection {
158160
case .mtp:
159161
proxyType = presentationData.strings.SocksProxySetup_ProxyTelegram

0 commit comments

Comments
 (0)