Save dc_id instead layer and salt in the session file

Server salts change every 30 minutes after all, so keeping them
in the long-term storage session file doesn't make much sense.

Saving the layer doesn't make sense either, as it was only used
to know whether to init connection or not, but it should be done
always.
This commit is contained in:
Lonami Exo
2017-12-28 01:04:11 +01:00
parent 21e5f0b547
commit ab07f0220a
3 changed files with 26 additions and 64 deletions

View File

@@ -18,7 +18,7 @@ class HigherLevelTests(unittest.TestCase):
@staticmethod
def test_cdn_download():
client = TelegramClient(None, api_id, api_hash)
client.session.server_address = '149.154.167.40'
client.session.set_dc(0, '149.154.167.40', 80)
assert client.connect()
try: