1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-06-27 13:06:45 +02:00

Display a user warning when log fails to initialize

This commit is contained in:
Jfreegman
2015-08-19 00:42:28 -04:00
committed by cnhenry
parent c546df3917
commit 19cfe3d393
6 changed files with 29 additions and 13 deletions

View File

@ -1164,11 +1164,13 @@ static void chat_onInit(ToxWindow *self, Tox *m)
char myid[TOX_ADDRESS_SIZE];
tox_self_get_address(m, (uint8_t *) myid);
log_enable(nick, myid, Friends.list[self->num].pub_key, ctx->log, LOG_CHAT);
int log_ret = log_enable(nick, myid, Friends.list[self->num].pub_key, ctx->log, LOG_CHAT);
load_chat_history(self, ctx->log);
if (!Friends.list[self->num].logging_on)
log_disable(ctx->log);
else if (log_ret == -1)
line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Warning: Log failed to initialize.");
execute(ctx->history, self, m, "/log", GLOBAL_COMMAND_MODE);