Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip log filter when log in chat config disabled #403

Merged
merged 1 commit into from
Feb 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/config/reader.c
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,7 @@ static SrnRet read_server_config_from_cfg(config_t *cfg, SrnServerConfig *srv_cf
}

static SrnRet read_chat_config_from_chat(config_setting_t *chat, SrnChatConfig *cfg){
config_setting_lookup_bool_ex(chat, "log", &cfg->log);
config_setting_lookup_bool_ex(chat, "notify", &cfg->ui->notify);
config_setting_lookup_bool_ex(chat, "show-topic", &cfg->ui->show_topic);
config_setting_lookup_bool_ex(chat, "show-avatar", &cfg->ui->show_avatar);
Expand Down
4 changes: 4 additions & 0 deletions src/filter/log_filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ bool filter(const SrnMessage *msg) {
char *file;
GString *basename;

if (!msg->chat->cfg->log) {
return TRUE;
}

date_str = g_date_time_format(msg->time, "%F");
g_return_val_if_fail(date_str, TRUE);

Expand Down
2 changes: 1 addition & 1 deletion src/inc/core/chat.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ struct _SrnChat {
};

struct _SrnChatConfig {
bool log; // TODO
bool log;
bool render_mirc_color;
char *password;
GList *auto_run_cmd_list;
Expand Down
Loading