Skip to content

Commit

Permalink
Merge pull request #920 from exciler/support_ipv6
Browse files Browse the repository at this point in the history
Add support for IPv6-only hosts
  • Loading branch information
tulir committed Jun 6, 2023
2 parents 7868b05 + dfe2280 commit 0411aff
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions mautrix_telegram/abstract_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ async def _init_client(self) -> None:
loop=self.loop,
base_logger=base_logger,
update_error_callback=self._telethon_update_error_callback,
use_ipv6=self.config["telegram.connection.use_ipv6"],
)
self.client.add_event_handler(self._update_catch)

Expand Down
1 change: 1 addition & 0 deletions mautrix_telegram/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ def do_update(self, helper: ConfigUpdateHelper) -> None:
copy("telegram.connection.retry_delay")
copy("telegram.connection.flood_sleep_threshold")
copy("telegram.connection.request_retries")
copy("telegram.connection.use_ipv6")

copy("telegram.device_info.device_model")
copy("telegram.device_info.system_version")
Expand Down
2 changes: 2 additions & 0 deletions mautrix_telegram/example-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,8 @@ telegram:
# is not recommended, since some requests can always trigger a call fail (such as searching
# for messages).
request_retries: 5
# Use IPv6 for Telethon connection
use_ipv6: false

# Device info sent to Telegram.
device_info:
Expand Down

0 comments on commit 0411aff

Please sign in to comment.