mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-02-18 04:20:57 +03:00
Fix StringSession usage of IPv6 (#3726)
This commit is contained in:
parent
8aa4d9a263
commit
4fae119a18
|
@ -74,15 +74,15 @@ class StringSession(MemorySession):
|
|||
if not self.state:
|
||||
return ''
|
||||
|
||||
if self.state.ipv6 is not None:
|
||||
ip = self.state.ipv6.to_bytes(16, 'big', signed=False)
|
||||
if self.dcs[self.state.dc_id].ipv6 is not None:
|
||||
ip = self.dcs[self.state.dc_id].ipv6.to_bytes(16, 'big', signed=False)
|
||||
else:
|
||||
ip = self.state.ipv6.to_bytes(4, 'big', signed=False)
|
||||
ip = self.dcs[self.state.dc_id].ipv6.to_bytes(4, 'big', signed=False)
|
||||
|
||||
return CURRENT_VERSION + StringSession.encode(struct.pack(
|
||||
_STRUCT_PREFORMAT.format(len(ip)),
|
||||
self.state.dc_id,
|
||||
ip,
|
||||
self.state.port,
|
||||
self.dcs[self.state.dc_id].port,
|
||||
self.dcs[self.state.dc_id].auth
|
||||
))
|
||||
|
|
Loading…
Reference in New Issue
Block a user