# HG changeset patch # User Nathan Walp # Date 1069657239 0 # Node ID 5381f96fc1853b8ff554f2723ab3e7e2b13d4fdd # Parent 072feee652442ebfbf28c74ee798a237740f46fd [gaim-migrate @ 8247] more logging tweaks. this should let the last get written to all the open logs when you quit gaim. committer: Tailor Script diff -r 072feee65244 -r 5381f96fc185 src/conversation.c --- a/src/conversation.c Mon Nov 24 06:50:20 2003 +0000 +++ b/src/conversation.c Mon Nov 24 07:00:39 2003 +0000 @@ -2755,5 +2755,7 @@ void gaim_conversations_uninit(void) { + /* close the conversations, which will also finalize the logs for us */ + gaim_conversation_foreach(gaim_conversation_destroy); gaim_signals_unregister_by_instance(gaim_conversations_get_handle()); } diff -r 072feee65244 -r 5381f96fc185 src/log.c --- a/src/log.c Mon Nov 24 06:50:20 2003 +0000 +++ b/src/log.c Mon Nov 24 07:00:39 2003 +0000 @@ -454,7 +454,8 @@ data->file = fopen(filename, "a"); if (!data->file) { - gaim_debug(GAIM_DEBUG_ERROR, "log", "Could not create log file %s\n", filename); + gaim_debug(GAIM_DEBUG_ERROR, "log", + "Could not create log file %s\n", filename); g_free(filename); return; } @@ -468,6 +469,11 @@ "

Conversation with %s at %s on %s (%s)

\n", log->name, date, gaim_account_get_username(log->account), prpl); } + + /* if we can't write to the file, give up before we hurt ourselves */ + if(!data->file) + return; + strftime(date, sizeof(date), "%H:%M:%S", localtime(&time)); if (type & GAIM_MESSAGE_SYSTEM) fprintf(data->file, "(%s) %s
\n", date, message); @@ -603,6 +609,10 @@ log->name, date, gaim_account_get_username(log->account), prpl); } + /* if we can't write to the file, give up before we hurt ourselves */ + if(!data->file) + return; + strftime(date, sizeof(date), "%H:%M:%S", localtime(&time)); stripped = gaim_markup_strip_html(message); if (type & GAIM_MESSAGE_SEND ||