Skip to content

Commit dd4d05e

Browse files
author
Yorhel
committed
Add 'log_hubchat' setting to disable logging of the main chat
Kinda annoying how this requires reopening the hub tab, but fixing that is a bit ugly.
1 parent c25bb34 commit dd4d05e

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

src/doc.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,10 @@ static const doc_set_t doc_sets[] = {
479479
{ "log_downloads", 0, "<boolean>",
480480
"Log downloaded files to transfers.log."
481481
},
482+
{ "log_hubchat", 1, "<boolean>",
483+
"Log the main hub chat. Note that changing this requires any affected hub"
484+
" tabs to be closed and reopened before the change is effective."
485+
},
482486
{ "log_uploads", 0, "<boolean>",
483487
"Log file uploads to transfers.log."
484488
},

src/uit_hub.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@ ui_tab_t *uit_hub_create(const char *name, gboolean conn) {
7070
t->tab.name = g_strdup_printf("#%s", name);
7171
t->tab.type = uit_hub;
7272
t->tab.hub = hub_create((ui_tab_t *)t);
73-
t->tab.log = ui_logwindow_create(t->tab.name, var_get_int(t->tab.hub->id, VAR_backlog));
73+
t->tab.log = ui_logwindow_create(
74+
var_get_bool(t->tab.hub->id, VAR_log_hubchat) ? t->tab.name : NULL,
75+
var_get_int(t->tab.hub->id, VAR_backlog));
7476
t->tab.log->handle = t;
7577
t->tab.log->checkchat = uit_hub_log_checkchat;
7678

src/vars.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -972,6 +972,7 @@ struct var_t {
972972
V(local_address, 1,1, f_id, p_ip, su_old, NULL, s_active_conf, db_vars_get(0, "active_bind"))\
973973
V(log_debug, 1,0, f_bool, p_bool, su_bool, NULL, s_log_debug, i_log_debug())\
974974
V(log_downloads, 1,0, f_bool, p_bool, su_bool, NULL, NULL, "true")\
975+
V(log_hubchat, 1,1, f_bool, p_bool, su_bool, NULL, NULL, "true")\
975976
V(log_uploads, 1,0, f_bool, p_bool, su_bool, NULL, NULL, "true")\
976977
V(minislots, 1,0, f_int, p_int_ge1, NULL, NULL, NULL, "3")\
977978
V(minislot_size, 1,0, f_minislot_size,p_minislot_size, NULL, NULL, NULL, "65536")\

0 commit comments

Comments
 (0)