# HG changeset patch # User Sean Egan # Date 1068684485 0 # Node ID 8f05bdc08fafefc32407c2abcd65271413c22775 # Parent c42d1532faabc7fd8304ae9ed403c3eb27d50dbf [gaim-migrate @ 8102] This will produce better logs. I'm going to try to get even *better* logs committer: Tailor Script diff -r c42d1532faab -r 8f05bdc08faf src/log.c --- a/src/log.c Wed Nov 12 23:42:43 2003 +0000 +++ b/src/log.c Thu Nov 13 00:48:05 2003 +0000 @@ -382,6 +382,7 @@ static void html_logger_write(GaimLog *log, GaimMessageFlags type, const char *from, time_t time, const char *message) { + GaimConnection *gc = gaim_account_get_connection(log->account); char date[64]; if(!log->logger_data) { /* This log is new */ @@ -436,7 +437,22 @@ log->name, date, gaim_account_get_username(log->account), prpl); } strftime(date, sizeof(date), "%H:%M:%S", localtime(&time)); - fprintf(log->logger_data, "(%s) %s%s %s
\n", date, from ? from : "", from ? ":" : "", message); + if (type & GAIM_MESSAGE_SYSTEM) + fprintf(log->logger_data, "(%s) %s
\n", date, message); + else if (type & GAIM_MESSAGE_WHISPER) + fprintf(log->logger_data, "(%s) %s: %s
\n", + date, from, message); + else if (type & GAIM_MESSAGE_AUTO_RESP) { + if (type & GAIM_MESSAGE_SEND) + fprintf(log->logger_data, _("(%s) %s : %s
\n"), date, from, message); + else if (type & GAIM_MESSAGE_RECV) + fprintf(log->logger_data, _("(%s) %s : %s
\n"), date, from, message); + } else if (type & GAIM_MESSAGE_RECV) + fprintf(log->logger_data, "(%s) %s: %s
\n", + date, from, gc->prpl->info->name, message); + else if (type & GAIM_MESSAGE_RECV) + fprintf(log->logger_data, "(%s) %s: %s
\n", + date, from, gc->prpl->info->name, message); fflush(log->logger_data); } @@ -546,7 +562,22 @@ strftime(date, sizeof(date), "%H:%M:%S", localtime(&time)); stripped = gaim_markup_strip_html(message); - fprintf(log->logger_data, "(%s) %s%s %s\n", date, from ? from : "", from ? ":" : "", stripped); + if (type & GAIM_MESSAGE_SEND || + type & GAIM_MESSAGE_RECV) + fprintf(log->logger_data, "(%s) %s: %s\n", date, from, stripped); + else if (type & GAIM_MESSAGE_SYSTEM) + fprintf(log->logger_data, "(%s) %s\n", date, stripped); + else if (type & GAIM_MESSAGE_AUTO_RESP) + fprintf(log->logger_data, _("(%s) %s : %s\n"), date, from, stripped); + else if (type & GAIM_MESSAGE_NO_LOG) { + /* This shouldn't happen */ + g_free(stripped); + return; + } else if (type & GAIM_MESSAGE_WHISPER) + fprintf(log->logger_data, "(%s) *%s* %s", date, from, stripped); + else + fprintf(log->logger_data, "(%s) %s%s %s\n", date, from ? from : "", from ? ":" : "", stripped); + fflush(log->logger_data); g_free(stripped); }