comparison src/conversation.c @ 7431:643cbc9a6035

[gaim-migrate @ 8036] This is good enough for CVS. This is new logging. It centers around the highly modular "GaimLogLogger," which controls how to write the log. Currently I only have the plain text logger. I wrote the beginning of an XML logger, but decided I didn't think it was that great an idea. Plugins can implement loggers themselves, so you can have, like, an SQL logger or something. The default logger writes to a file unique to the conversation, and they're saved on disk in a heirarchical fashion: ~/.gaim/logs/aim/seanegn/robflynn-date.log would be a conversation I had with Rob on date. What doesn't work: System logging The search button in the log viewer. Oh, chats probably don't log either, I didn't test. You can only log in plain text right now. Obviously, it's not done yet. But you can play around with it, and give it some love. I'll get back to it tomorrow after school, maybe. committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Wed, 05 Nov 2003 06:15:49 +0000
parents 1930e3d00ecd
children a899742289c2
comparison
equal deleted inserted replaced
7430:783eea64614c 7431:643cbc9a6035
805 conv->title = g_strdup(name); 805 conv->title = g_strdup(name);
806 conv->send_history = g_list_append(NULL, NULL); 806 conv->send_history = g_list_append(NULL, NULL);
807 conv->history = g_string_new(""); 807 conv->history = g_string_new("");
808 conv->data = g_hash_table_new_full(g_str_hash, g_str_equal, 808 conv->data = g_hash_table_new_full(g_str_hash, g_str_equal,
809 g_free, NULL); 809 g_free, NULL);
810 conv->log = gaim_log_new(GAIM_LOG_IM, name, account, time(NULL));
811
810 812
811 if (type == GAIM_CONV_IM) 813 if (type == GAIM_CONV_IM)
812 { 814 {
813 conv->u.im = g_new0(GaimConvIm, 1); 815 conv->u.im = g_new0(GaimConvIm, 1);
814 conv->u.im->conv = conv; 816 conv->u.im->conv = conv;
998 } 1000 }
999 1001
1000 if (ops != NULL && ops->destroy_conversation != NULL) 1002 if (ops != NULL && ops->destroy_conversation != NULL)
1001 ops->destroy_conversation(conv); 1003 ops->destroy_conversation(conv);
1002 1004
1005 gaim_log_free(conv->log);
1003 g_free(conv); 1006 g_free(conv);
1004 } 1007 }
1005 1008
1006 GaimConversationType 1009 GaimConversationType
1007 gaim_conversation_get_type(const GaimConversation *conv) 1010 gaim_conversation_get_type(const GaimConversation *conv)
1392 !(prpl_info->options & OPT_PROTO_UNIQUE_CHATNAME)) { 1395 !(prpl_info->options & OPT_PROTO_UNIQUE_CHATNAME)) {
1393 1396
1394 if (who == NULL) { 1397 if (who == NULL) {
1395 if (flags & GAIM_MESSAGE_SEND) { 1398 if (flags & GAIM_MESSAGE_SEND) {
1396 b = gaim_find_buddy(account, 1399 b = gaim_find_buddy(account,
1397 gaim_account_get_username(account)); 1400 gaim_account_get_username(account));
1398 1401
1399 if (b != NULL && strcmp(b->name, gaim_get_buddy_alias(b))) 1402 if (b != NULL && strcmp(b->name, gaim_get_buddy_alias(b)))
1400 who = gaim_get_buddy_alias(b); 1403 who = gaim_get_buddy_alias(b);
1401 else if (gaim_account_get_alias(account) != NULL) 1404 else if (gaim_account_get_alias(account) != NULL)
1402 who = account->alias; 1405 who = account->alias;
1405 else 1408 else
1406 who = gaim_account_get_username(account); 1409 who = gaim_account_get_username(account);
1407 } 1410 }
1408 else { 1411 else {
1409 b = gaim_find_buddy(account, 1412 b = gaim_find_buddy(account,
1410 gaim_conversation_get_name(conv)); 1413 gaim_conversation_get_name(conv));
1411 1414
1412 if (b != NULL) 1415 if (b != NULL)
1413 who = gaim_get_buddy_alias(b); 1416 who = gaim_get_buddy_alias(b);
1414 else 1417 else
1415 who = gaim_conversation_get_name(conv); 1418 who = gaim_conversation_get_name(conv);
1422 who = gaim_get_buddy_alias(b); 1425 who = gaim_get_buddy_alias(b);
1423 } 1426 }
1424 } 1427 }
1425 } 1428 }
1426 1429
1430 gaim_log_write(conv->log, flags, who, mtime, message);
1427 ops->write_conv(conv, who, message, flags, mtime); 1431 ops->write_conv(conv, who, message, flags, mtime);
1428 1432
1429 win = gaim_conversation_get_window(conv); 1433 win = gaim_conversation_get_window(conv);
1430 1434
1431 /* Tab highlighting */ 1435 /* Tab highlighting */