mirror of
https://github.com/danog/telegram-tt.git
synced 2024-11-30 04:39:00 +01:00
GramJs: Use "-1" DCs for file transfers (#1332)
This commit is contained in:
parent
3455f73ef3
commit
dbc5949957
@ -605,37 +605,37 @@ function isListLike(item) {
|
||||
)
|
||||
}
|
||||
*/
|
||||
function getDC(dcId) {
|
||||
function getDC(dcId, download = false) {
|
||||
// TODO Move to external config
|
||||
switch (dcId) {
|
||||
case 1:
|
||||
return {
|
||||
id: 1,
|
||||
ipAddress: 'zws1.web.telegram.org',
|
||||
ipAddress: `zws1${download ? '-1' : ''}.web.telegram.org`,
|
||||
port: 443,
|
||||
};
|
||||
case 2:
|
||||
return {
|
||||
id: 2,
|
||||
ipAddress: 'zws2.web.telegram.org',
|
||||
ipAddress: `zws2${download ? '-1' : ''}.web.telegram.org`,
|
||||
port: 443,
|
||||
};
|
||||
case 3:
|
||||
return {
|
||||
id: 3,
|
||||
ipAddress: 'zws3.web.telegram.org',
|
||||
ipAddress: `zws3${download ? '-1' : ''}.web.telegram.org`,
|
||||
port: 443,
|
||||
};
|
||||
case 4:
|
||||
return {
|
||||
id: 4,
|
||||
ipAddress: 'zws4.web.telegram.org',
|
||||
ipAddress: `zws4${download ? '-1' : ''}.web.telegram.org`,
|
||||
port: 443,
|
||||
};
|
||||
case 5:
|
||||
return {
|
||||
id: 5,
|
||||
ipAddress: 'zws5.web.telegram.org',
|
||||
ipAddress: `zws5${download ? '-1' : ''}.web.telegram.org`,
|
||||
port: 443,
|
||||
};
|
||||
default:
|
||||
|
@ -325,7 +325,7 @@ class TelegramClient {
|
||||
}
|
||||
|
||||
async _connectSender(sender, dcId) {
|
||||
const dc = utils.getDC(dcId);
|
||||
const dc = utils.getDC(dcId, true);
|
||||
|
||||
while (true) {
|
||||
try {
|
||||
|
Loading…
Reference in New Issue
Block a user