added key to disable link previews
This commit is contained in:
parent
ba1988b530
commit
0e2db10aa9
4
loop.c
4
loop.c
@ -108,6 +108,7 @@ void (*on_string_cb)(struct tgl_state *TLS, char *str, void *arg);
|
||||
void *string_cb_arg;
|
||||
char *one_string_prompt;
|
||||
int one_string_flags;
|
||||
extern int disable_link_preview;
|
||||
|
||||
void deactivate_readline (void);
|
||||
void reactivate_readline (void);
|
||||
@ -683,6 +684,9 @@ int loop (void) {
|
||||
if (ipv6_enabled) {
|
||||
tgl_enable_ipv6 (TLS);
|
||||
}
|
||||
if (disable_link_preview) {
|
||||
tgl_disable_link_preview (TLS);
|
||||
}
|
||||
tgl_init (TLS);
|
||||
|
||||
if (binlog_enabled) {
|
||||
|
6
main.c
6
main.c
@ -119,6 +119,7 @@ int port;
|
||||
int use_ids;
|
||||
int ipv6_enabled;
|
||||
char *start_command;
|
||||
int disable_link_preview;
|
||||
|
||||
struct tgl_state *TLS;
|
||||
|
||||
@ -478,6 +479,7 @@ void usage (void) {
|
||||
printf (" --enable-ipv6/-6 use ipv6 (may be unstable)\n");
|
||||
printf (" --help/-h prints this help\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);
|
||||
}
|
||||
@ -622,6 +624,7 @@ void args_parse (int argc, char **argv) {
|
||||
{"enable-ipv6", no_argument, 0, '6'},
|
||||
{"help", no_argument, 0, 'h'},
|
||||
{"accept-any-tcp", no_argument, 0, 1001},
|
||||
{"disable-link-preview", no_argument, 0, 1002},
|
||||
{0, 0, 0, 0 }
|
||||
};
|
||||
|
||||
@ -732,6 +735,9 @@ void args_parse (int argc, char **argv) {
|
||||
case '6':
|
||||
ipv6_enabled = 1;
|
||||
break;
|
||||
case 1002:
|
||||
disable_link_preview = 2;
|
||||
break;
|
||||
case 'h':
|
||||
default:
|
||||
usage ();
|
||||
|
2
tgl
2
tgl
@ -1 +1 @@
|
||||
Subproject commit 0f76784c972feb7824a40d1c33dde898fbeced63
|
||||
Subproject commit 6e014b76a256ba8ea88f24a3624e1e3a51adfb66
|
Loading…
Reference in New Issue
Block a user