src/conversation.c

changeset 7431
f3eaace13491
parent 7261
4be05820d441
child 7511
0d98123a9378
equal deleted inserted replaced
7430:bf3e9ac3302e 7431:f3eaace13491
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 */

mercurial