comparison src/log.c @ 7453:6f5918e4f668

[gaim-migrate @ 8066] SimGuy claims this makes up for windows sucking committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Fri, 07 Nov 2003 02:27:24 +0000
parents 0e7a835e2433
children 8bc33ec515a1
comparison
equal deleted inserted replaced
7452:20cb73e1e964 7453:6f5918e4f668
286 const char *prpl = GAIM_PLUGIN_PROTOCOL_INFO 286 const char *prpl = GAIM_PLUGIN_PROTOCOL_INFO
287 (gaim_find_prpl(gaim_account_get_protocol(log->account)))->list_icon(log->account, NULL); 287 (gaim_find_prpl(gaim_account_get_protocol(log->account)))->list_icon(log->account, NULL);
288 char *dir; 288 char *dir;
289 FILE *file; 289 FILE *file;
290 290
291 strftime(date, sizeof(date), "%F.%H%M%S.xml", localtime(&log->time)); 291 strftime(date, sizeof(date), "%Y-%m-%d.%H%M%S.xml", localtime(&log->time));
292 292
293 dir = g_build_filename(ud, "logs", NULL); 293 dir = g_build_filename(ud, "logs", NULL);
294 mkdir (dir, S_IRUSR | S_IWUSR | S_IXUSR); 294 mkdir (dir, S_IRUSR | S_IWUSR | S_IXUSR);
295 g_free(dir); 295 g_free(dir);
296 dir = g_build_filename(ud, "logs", 296 dir = g_build_filename(ud, "logs",
321 return; 321 return;
322 } 322 }
323 fprintf(log->logger_data, "<?xml version='1.0' encoding='UTF-8' ?>\n" 323 fprintf(log->logger_data, "<?xml version='1.0' encoding='UTF-8' ?>\n"
324 "<?xml-stylesheet href='file:///usr/src/web/htdocs/log-stylesheet.xsl' type='text/xml' ?>\n"); 324 "<?xml-stylesheet href='file:///usr/src/web/htdocs/log-stylesheet.xsl' type='text/xml' ?>\n");
325 325
326 strftime(date, sizeof(date), "%F %T", localtime(&log->time)); 326 strftime(date, sizeof(date), "%Y-%m-%d %H:%M:%S", localtime(&log->time));
327 fprintf(log->logger_data, "<conversation time='%s' screenname='%s' protocol='%s'>\n", 327 fprintf(log->logger_data, "<conversation time='%s' screenname='%s' protocol='%s'>\n",
328 date, log->name, prpl); 328 date, log->name, prpl);
329 } 329 }
330 330
331 strftime(date, sizeof(date), "%T", localtime(&time)); 331 strftime(date, sizeof(date), "%H:%M:%S", localtime(&time));
332 gaim_markup_html_to_xhtml(message, &xhtml, NULL); 332 gaim_markup_html_to_xhtml(message, &xhtml, NULL);
333 if (from) 333 if (from)
334 fprintf(log->logger_data, "<message %s %s from='%s' time='%s'>%s</message>\n", 334 fprintf(log->logger_data, "<message %s %s from='%s' time='%s'>%s</message>\n",
335 str_from_msg_type(type), 335 str_from_msg_type(type),
336 type & GAIM_MESSAGE_SEND ? "direction='sent'" : 336 type & GAIM_MESSAGE_SEND ? "direction='sent'" :
390 const char *prpl = GAIM_PLUGIN_PROTOCOL_INFO 390 const char *prpl = GAIM_PLUGIN_PROTOCOL_INFO
391 (gaim_find_prpl(gaim_account_get_protocol(log->account)))->list_icon(log->account, NULL); 391 (gaim_find_prpl(gaim_account_get_protocol(log->account)))->list_icon(log->account, NULL);
392 char *dir; 392 char *dir;
393 FILE *file; 393 FILE *file;
394 394
395 strftime(date, sizeof(date), "%F.%H%M%S.txt", localtime(&log->time)); 395 strftime(date, sizeof(date), "%Y-%m-%d.%H%M%S.txt", localtime(&log->time));
396 396
397 dir = g_build_filename(ud, "logs", NULL); 397 dir = g_build_filename(ud, "logs", NULL);
398 mkdir (dir, S_IRUSR | S_IWUSR | S_IXUSR); 398 mkdir (dir, S_IRUSR | S_IWUSR | S_IXUSR);
399 g_free(dir); 399 g_free(dir);
400 dir = g_build_filename(ud, "logs", 400 dir = g_build_filename(ud, "logs",
423 if (!log->logger_data) { 423 if (!log->logger_data) {
424 gaim_debug(GAIM_DEBUG_ERROR, "log", "Could not create log file %s\n", filename); 424 gaim_debug(GAIM_DEBUG_ERROR, "log", "Could not create log file %s\n", filename);
425 return; 425 return;
426 } 426 }
427 g_free(filename); 427 g_free(filename);
428 strftime(date, sizeof(date), "%F %T", localtime(&log->time)); 428 strftime(date, sizeof(date), "%Y-%m-%d %H:%M:%S", localtime(&log->time));
429 fprintf(log->logger_data, "Conversation with %s at %s on %s (%s)\n", 429 fprintf(log->logger_data, "Conversation with %s at %s on %s (%s)\n",
430 log->name, date, gaim_account_get_username(log->account), prpl); 430 log->name, date, gaim_account_get_username(log->account), prpl);
431 } 431 }
432 432
433 strftime(date, sizeof(date), "%T", localtime(&time)); 433 strftime(date, sizeof(date), "%H:%M:%S", localtime(&time));
434 stripped = gaim_markup_strip_html(message); 434 stripped = gaim_markup_strip_html(message);
435 fprintf(log->logger_data, "(%s) %s%s %s\n", date, from ? from : "", from ? ":" : "", stripped); 435 fprintf(log->logger_data, "(%s) %s%s %s\n", date, from ? from : "", from ? ":" : "", stripped);
436 fflush(log->logger_data); 436 fflush(log->logger_data);
437 g_free(stripped); 437 g_free(stripped);
438 } 438 }