diff --git a/loop.c b/loop.c index 2fbd8e0..3e260dc 100644 --- a/loop.c +++ b/loop.c @@ -97,6 +97,7 @@ extern volatile int sigterm_cnt; extern char *start_command; extern struct tgl_state *TLS; +extern int ipv6_enabled; struct event *term_ev = 0; int read_one_string; @@ -675,6 +676,9 @@ int loop (void) { tgl_set_download_directory (TLS, get_downloads_directory ()); tgl_register_app_id (TLS, TELEGRAM_CLI_APP_ID, TELEGRAM_CLI_APP_HASH); tgl_set_app_version (TLS, "Telegram-cli " TELEGRAM_CLI_VERSION); + if (ipv6_enabled) { + tgl_enable_ipv6 (TLS); + } tgl_init (TLS); if (binlog_enabled) { diff --git a/main.c b/main.c index 474f242..db69eba 100644 --- a/main.c +++ b/main.c @@ -116,6 +116,7 @@ int disable_output; int reset_authorization; int port; int use_ids; +int ipv6_enabled; char *start_command; struct tgl_state *TLS; @@ -473,6 +474,7 @@ void usage (void) { printf (" -S unix socket to create\n"); printf (" -e make commands end exit\n"); printf (" -I use user and chat IDs in updates instead of names\n"); + printf (" -6 use ipv6 (may be unstable)\n"); exit (1); } @@ -576,7 +578,7 @@ char *unix_socket; void args_parse (int argc, char **argv) { TLS = tgl_state_alloc (); int opt = 0; - while ((opt = getopt (argc, argv, "u:hk:vNl:fEwWCRdL:DU:G:qP:S:e:I" + while ((opt = getopt (argc, argv, "u:hk:vNl:fEwWCRdL:DU:G:qP:S:e:I6" #ifdef HAVE_LIBCONFIG "c:p:" #else @@ -671,6 +673,9 @@ void args_parse (int argc, char **argv) { case 'I': use_ids ++; break; + case '6': + ipv6_enabled = 1; + break; case 'h': default: usage (); diff --git a/tgl b/tgl index 7f37026..354f206 160000 --- a/tgl +++ b/tgl @@ -1 +1 @@ -Subproject commit 7f370266688aed5329ea576e9795bb27e74b2bfe +Subproject commit 354f2064fcb1dd9de1e1abdb091daf532d735b4a