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:
10
src/log.c
10
src/log.c
@ -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 */
|
||||
|
Reference in New Issue
Block a user