1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-07-03 12: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
parent 2a787c1097
commit 92d76c7f99
6 changed files with 29 additions and 13 deletions

View File

@ -153,15 +153,19 @@ void log_disable(struct chatlog *log)
memset(log, 0, sizeof(struct chatlog));
}
void log_enable(char *name, const char *selfkey, const char *otherkey, struct chatlog *log, int logtype)
int log_enable(char *name, const char *selfkey, const char *otherkey, struct chatlog *log, int logtype)
{
log->log_on = true;
if (log->file != NULL)
return;
return 0;
if (init_logging_session(name, selfkey, otherkey, log, logtype) == -1)
if (init_logging_session(name, selfkey, otherkey, log, logtype) == -1) {
log_disable(log);
return -1;
}
return 0;
}
/* Loads previous history from chat log */