From 4acfe841718e256fb783eb16b5f5b9962bbf4126 Mon Sep 17 00:00:00 2001 From: Jfreegman Date: Sun, 30 Nov 2014 12:20:01 -0500 Subject: [PATCH] remove spammy connection messages --- src/toxic.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/toxic.c b/src/toxic.c index 8a6db4a..0ce4019 100644 --- a/src/toxic.c +++ b/src/toxic.c @@ -436,8 +436,6 @@ static void do_connection(Tox *m, ToxWindow *prompt) if (arg_opts.no_connect == 1) return; - char msg[MAX_STR_SIZE] = {0}; - static int conn_err = 0; static bool was_connected = false; static uint64_t last_conn_try = 0; @@ -450,23 +448,18 @@ static void do_connection(Tox *m, ToxWindow *prompt) if (!was_connected && is_connected) { was_connected = true; prompt_update_connectionstatus(prompt, was_connected); - snprintf(msg, sizeof(msg), "DHT connected"); } else if (was_connected && !is_connected) { was_connected = false; prompt_update_connectionstatus(prompt, was_connected); - snprintf(msg, sizeof(msg), "DHT disconnected. Attempting to reconnect."); } else if (!was_connected && !is_connected && timed_out(last_conn_try, curtime, TRY_CONNECT)) { /* if autoconnect has already failed there's no point in trying again */ if (conn_err == 0) { last_conn_try = curtime; if ((conn_err = init_connection(m)) != 0) - snprintf(msg, sizeof(msg), "Auto-connect failed with error code %d", conn_err); + line_info_add(prompt, NULL, NULL, NULL, SYS_MSG, 0, 0, "Auto-connect failed with error code %d", conn_err); } } - - if (msg[0]) - line_info_add(prompt, NULL, NULL, NULL, SYS_MSG, 0, 0, msg); } static void load_friendlist(Tox *m)