Commit 0e2db10a authored by vvaltman's avatar vvaltman

added key to disable link previews

parent ba1988b5
...@@ -108,6 +108,7 @@ void (*on_string_cb)(struct tgl_state *TLS, char *str, void *arg); ...@@ -108,6 +108,7 @@ void (*on_string_cb)(struct tgl_state *TLS, char *str, void *arg);
void *string_cb_arg; void *string_cb_arg;
char *one_string_prompt; char *one_string_prompt;
int one_string_flags; int one_string_flags;
extern int disable_link_preview;
void deactivate_readline (void); void deactivate_readline (void);
void reactivate_readline (void); void reactivate_readline (void);
...@@ -683,6 +684,9 @@ int loop (void) { ...@@ -683,6 +684,9 @@ int loop (void) {
if (ipv6_enabled) { if (ipv6_enabled) {
tgl_enable_ipv6 (TLS); tgl_enable_ipv6 (TLS);
} }
if (disable_link_preview) {
tgl_disable_link_preview (TLS);
}
tgl_init (TLS); tgl_init (TLS);
if (binlog_enabled) { if (binlog_enabled) {
......
...@@ -119,6 +119,7 @@ int port; ...@@ -119,6 +119,7 @@ int port;
int use_ids; int use_ids;
int ipv6_enabled; int ipv6_enabled;
char *start_command; char *start_command;
int disable_link_preview;
struct tgl_state *TLS; struct tgl_state *TLS;
...@@ -478,6 +479,7 @@ void usage (void) { ...@@ -478,6 +479,7 @@ void usage (void) {
printf (" --enable-ipv6/-6 use ipv6 (may be unstable)\n"); printf (" --enable-ipv6/-6 use ipv6 (may be unstable)\n");
printf (" --help/-h prints this help\n"); printf (" --help/-h prints this help\n");
printf (" --accept-any-tcp accepts tcp connections from any src (only loopback by default)\n"); printf (" --accept-any-tcp accepts tcp connections from any src (only loopback by default)\n");
printf (" --disable-link-preview disables server-side previews to links\n");
exit (1); exit (1);
} }
...@@ -622,6 +624,7 @@ void args_parse (int argc, char **argv) { ...@@ -622,6 +624,7 @@ void args_parse (int argc, char **argv) {
{"enable-ipv6", no_argument, 0, '6'}, {"enable-ipv6", no_argument, 0, '6'},
{"help", no_argument, 0, 'h'}, {"help", no_argument, 0, 'h'},
{"accept-any-tcp", no_argument, 0, 1001}, {"accept-any-tcp", no_argument, 0, 1001},
{"disable-link-preview", no_argument, 0, 1002},
{0, 0, 0, 0 } {0, 0, 0, 0 }
}; };
...@@ -732,6 +735,9 @@ void args_parse (int argc, char **argv) { ...@@ -732,6 +735,9 @@ void args_parse (int argc, char **argv) {
case '6': case '6':
ipv6_enabled = 1; ipv6_enabled = 1;
break; break;
case 1002:
disable_link_preview = 2;
break;
case 'h': case 'h':
default: default:
usage (); usage ();
......
Subproject commit 0f76784c972feb7824a40d1c33dde898fbeced63 Subproject commit 6e014b76a256ba8ea88f24a3624e1e3a51adfb66
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment