mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-08-31 19:14:01 +03:00
FILE / ScuroNeko/mtg
mtglib/internal/dc/view.go
Исходный файл и его история в репозитории.
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
24 lines
426 B
Go
24 lines
426 B
Go
package dc
|
|
|
|
type dcView struct {
|
|
publicConfigs dcAddrSet
|
|
}
|
|
|
|
func (d dcView) getV4(dc int) []Addr {
|
|
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 {
|
|
var addrs []Addr
|
|
|
|
addrs = append(addrs, defaultDCAddrSet.getV6(dc)...)
|
|
addrs = append(addrs, d.publicConfigs.getV6(dc)...)
|
|
|
|
return addrs
|
|
}
|