comparison src/log.c @ 13069:42c62476b61b

[gaim-migrate @ 15431] SF User pomp pointed out that if you open a conversation window with an AIM buddy who is offline and hit Ctrl-O, you'll end up with an empty log. An error message shows in the conversation window, but such messages are not logged. This change logs error messages as well as logging any messages with a type we don't recognize (and files a debug message, since that shouldn't happen). committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Mon, 30 Jan 2006 04:51:12 +0000
parents 78fa9502715b
children f3abb141042a
comparison
equal deleted inserted replaced
13068:78fa9502715b 13069:42c62476b61b
959 if(log->type == GAIM_LOG_SYSTEM){ 959 if(log->type == GAIM_LOG_SYSTEM){
960 written += fprintf(data->file, "---- %s @ %s ----<br/>\n", msg_fixed, date); 960 written += fprintf(data->file, "---- %s @ %s ----<br/>\n", msg_fixed, date);
961 } else { 961 } else {
962 if (type & GAIM_MESSAGE_SYSTEM) 962 if (type & GAIM_MESSAGE_SYSTEM)
963 written += fprintf(data->file, "<font size=\"2\">(%s)</font><b> %s</b><br/>\n", date, msg_fixed); 963 written += fprintf(data->file, "<font size=\"2\">(%s)</font><b> %s</b><br/>\n", date, msg_fixed);
964 else if (type & GAIM_MESSAGE_ERROR)
965 written += fprintf(data->file, "<font color=\"#FF0000\"><font size=\"2\">(%s)</font><b> %s</b></font><br/>\n", date, msg_fixed);
964 else if (type & GAIM_MESSAGE_WHISPER) 966 else if (type & GAIM_MESSAGE_WHISPER)
965 written += fprintf(data->file, "<font color=\"#6C2585\"><font size=\"2\">(%s)</font><b> %s:</b></font> %s<br/>\n", 967 written += fprintf(data->file, "<font color=\"#6C2585\"><font size=\"2\">(%s)</font><b> %s:</b></font> %s<br/>\n",
966 date, from, msg_fixed); 968 date, from, msg_fixed);
967 else if (type & GAIM_MESSAGE_AUTO_RESP) { 969 else if (type & GAIM_MESSAGE_AUTO_RESP) {
968 if (type & GAIM_MESSAGE_SEND) 970 if (type & GAIM_MESSAGE_SEND)
981 written += fprintf(data->file, "<font color=\"#062585\"><font size=\"2\">(%s)</font> <b>***%s</b></font> %s<br/>\n", 983 written += fprintf(data->file, "<font color=\"#062585\"><font size=\"2\">(%s)</font> <b>***%s</b></font> %s<br/>\n",
982 date, from, msg_fixed); 984 date, from, msg_fixed);
983 else 985 else
984 written += fprintf(data->file, "<font color=\"#16569E\"><font size=\"2\">(%s)</font> <b>%s:</b></font> %s<br/>\n", 986 written += fprintf(data->file, "<font color=\"#16569E\"><font size=\"2\">(%s)</font> <b>%s:</b></font> %s<br/>\n",
985 date, from, msg_fixed); 987 date, from, msg_fixed);
988 } else {
989 gaim_debug_error("log", "Unhandled message type.");
990 written += fprintf(data->file, "<font size=\"2\">(%s)</font><b> %s:</b></font> %s<br/>\n",
991 date, from, msg_fixed);
986 } 992 }
987 } 993 }
988 g_free(date); 994 g_free(date);
989 g_free(msg_fixed); 995 g_free(msg_fixed);
990 fflush(data->file); 996 fflush(data->file);