From 1fcec38aeaba82de9a7c3a04f06cc86a4145235a Mon Sep 17 00:00:00 2001 From: 9seconds Date: Tue, 31 Mar 2026 11:05:49 +0200 Subject: [PATCH] Change IP address set priority For a couple of releases we use collected IPs as a prioritized source for connecting to Telegram. But apparently, they work way worse than it should, and having connectivity to core ip ALWAYS gives better results. Thus, this PR flips priorities, so users could have auto-update enabled as a source of secondary addresses, not primary ones --- mtglib/internal/dc/view.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mtglib/internal/dc/view.go b/mtglib/internal/dc/view.go index e4980a76b..9f9e76dbc 100644 --- a/mtglib/internal/dc/view.go +++ b/mtglib/internal/dc/view.go @@ -5,15 +5,19 @@ type dcView struct { } func (d dcView) getV4(dc int) []Addr { - addrs := d.publicConfigs.getV4(dc) + var addrs []Addr + addrs = append(addrs, defaultDCAddrSet.getV4(dc)...) + addrs = append(addrs, d.publicConfigs.getV4(dc)...) return addrs } func (d dcView) getV6(dc int) []Addr { - addrs := d.publicConfigs.getV6(dc) + var addrs []Addr + addrs = append(addrs, defaultDCAddrSet.getV6(dc)...) + addrs = append(addrs, d.publicConfigs.getV6(dc)...) return addrs }