libpurple/log.c

changeset 15483
bfcce3ec6848
parent 15444
b793ef258d23
child 15575
bd1e13b63e4b
equal deleted inserted replaced
15482:b943b932a41b 15483:bfcce3ec6848
462 const GaimLogSet *set = key; 462 const GaimLogSet *set = key;
463 463
464 /* The account isn't hashed because we need GaimLogSets with NULL accounts 464 /* The account isn't hashed because we need GaimLogSets with NULL accounts
465 * to be found when we search by a GaimLogSet that has a non-NULL account 465 * to be found when we search by a GaimLogSet that has a non-NULL account
466 * but the same type and name. */ 466 * but the same type and name. */
467 return g_int_hash((gint *)&set->type) + g_str_hash(set->name); 467 return g_int_hash(&set->type) + g_str_hash(set->name);
468 } 468 }
469 469
470 static gboolean 470 static gboolean
471 log_set_equal(gconstpointer a, gconstpointer b) 471 log_set_equal(gconstpointer a, gconstpointer b)
472 { 472 {
1103 if(log->type == GAIM_LOG_SYSTEM){ 1103 if(log->type == GAIM_LOG_SYSTEM){
1104 written += fprintf(data->file, "---- %s @ %s ----<br/>\n", msg_fixed, date); 1104 written += fprintf(data->file, "---- %s @ %s ----<br/>\n", msg_fixed, date);
1105 } else { 1105 } else {
1106 if (type & GAIM_MESSAGE_SYSTEM) 1106 if (type & GAIM_MESSAGE_SYSTEM)
1107 written += fprintf(data->file, "<font size=\"2\">(%s)</font><b> %s</b><br/>\n", date, msg_fixed); 1107 written += fprintf(data->file, "<font size=\"2\">(%s)</font><b> %s</b><br/>\n", date, msg_fixed);
1108 else if (type & GAIM_MESSAGE_RAW)
1109 written += fprintf(data->file, "<font size=\"2\">(%s)</font> %s<br/>\n", date, msg_fixed);
1108 else if (type & GAIM_MESSAGE_ERROR) 1110 else if (type & GAIM_MESSAGE_ERROR)
1109 written += fprintf(data->file, "<font color=\"#FF0000\"><font size=\"2\">(%s)</font><b> %s</b></font><br/>\n", date, msg_fixed); 1111 written += fprintf(data->file, "<font color=\"#FF0000\"><font size=\"2\">(%s)</font><b> %s</b></font><br/>\n", date, msg_fixed);
1110 else if (type & GAIM_MESSAGE_WHISPER) 1112 else if (type & GAIM_MESSAGE_WHISPER)
1111 written += fprintf(data->file, "<font color=\"#6C2585\"><font size=\"2\">(%s)</font><b> %s:</b></font> %s<br/>\n", 1113 written += fprintf(data->file, "<font color=\"#6C2585\"><font size=\"2\">(%s)</font><b> %s:</b></font> %s<br/>\n",
1112 date, from, msg_fixed); 1114 date, from, msg_fixed);
1254 stripped); 1256 stripped);
1255 else 1257 else
1256 written += fprintf(data->file, "(%s) %s: %s\n", date, from, 1258 written += fprintf(data->file, "(%s) %s: %s\n", date, from,
1257 stripped); 1259 stripped);
1258 } 1260 }
1259 } else if (type & GAIM_MESSAGE_SYSTEM) 1261 } else if (type & GAIM_MESSAGE_SYSTEM ||
1262 type & GAIM_MESSAGE_ERROR ||
1263 type & GAIM_MESSAGE_RAW)
1260 written += fprintf(data->file, "(%s) %s\n", date, stripped); 1264 written += fprintf(data->file, "(%s) %s\n", date, stripped);
1261 else if (type & GAIM_MESSAGE_NO_LOG) { 1265 else if (type & GAIM_MESSAGE_NO_LOG) {
1262 /* This shouldn't happen */ 1266 /* This shouldn't happen */
1263 g_free(stripped); 1267 g_free(stripped);
1264 return written; 1268 return written;

mercurial