Mercurial > pidgin.yaz
comparison src/conversation.c @ 6846:8ab95f4c9800
[gaim-migrate @ 7391]
Added new buddy icon caching code. Each GaimBuddy has its own icon, and the
complete list of all icons is now stored in a set of hashtables for quick
retrieval. Buddy icons now live much happier in the core, with the magma
and tooth fairies (that's where they really live).
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Mon, 15 Sep 2003 07:35:49 +0000 |
parents | f098765ac919 |
children | 083d1e4a9c78 |
comparison
equal
deleted
inserted
replaced
6845:5de4d9a4e0e2 | 6846:8ab95f4c9800 |
---|---|
978 win = gaim_conversation_get_window(conv); | 978 win = gaim_conversation_get_window(conv); |
979 ops = gaim_conversation_get_ui_ops(conv); | 979 ops = gaim_conversation_get_ui_ops(conv); |
980 gc = gaim_conversation_get_gc(conv); | 980 gc = gaim_conversation_get_gc(conv); |
981 name = gaim_conversation_get_name(conv); | 981 name = gaim_conversation_get_name(conv); |
982 | 982 |
983 if (gc) { | 983 if (gc != NULL) { |
984 /* Still connected */ | 984 /* Still connected */ |
985 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl); | 985 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl); |
986 | 986 |
987 if (gaim_conversation_get_type(conv) == GAIM_CONV_IM) { | 987 if (gaim_conversation_get_type(conv) == GAIM_CONV_IM) { |
988 if (gaim_prefs_get_bool("/core/conversations/im/send_typing")) | 988 if (gaim_prefs_get_bool("/core/conversations/im/send_typing")) |
1050 g_free(snode->data); | 1050 g_free(snode->data); |
1051 } | 1051 } |
1052 | 1052 |
1053 g_slist_free(conv->u.im->images); | 1053 g_slist_free(conv->u.im->images); |
1054 | 1054 |
1055 if (conv->u.im->icon != NULL) | |
1056 gaim_buddy_icon_unref(conv->u.im->icon); | |
1057 | |
1055 g_free(conv->u.im); | 1058 g_free(conv->u.im); |
1056 | 1059 |
1057 ims = g_list_remove(ims, conv); | 1060 ims = g_list_remove(ims, conv); |
1058 } | 1061 } |
1059 else if (conv->type == GAIM_CONV_CHAT) { | 1062 else if (conv->type == GAIM_CONV_CHAT) { |
1571 | 1574 |
1572 return im->conv; | 1575 return im->conv; |
1573 } | 1576 } |
1574 | 1577 |
1575 void | 1578 void |
1579 gaim_im_set_icon(GaimIm *im, GaimBuddyIcon *icon) | |
1580 { | |
1581 g_return_if_fail(im != NULL); | |
1582 | |
1583 if (im->icon == icon) | |
1584 return; | |
1585 | |
1586 if (im->icon != NULL) | |
1587 gaim_buddy_icon_unref(im->icon); | |
1588 | |
1589 im->icon = (icon == NULL ? NULL : gaim_buddy_icon_ref(icon)); | |
1590 | |
1591 gaim_conversation_update(gaim_im_get_conversation(im), | |
1592 GAIM_CONV_UPDATE_ICON); | |
1593 } | |
1594 | |
1595 GaimBuddyIcon * | |
1596 gaim_im_get_icon(const GaimIm *im) | |
1597 { | |
1598 g_return_val_if_fail(im != NULL, NULL); | |
1599 | |
1600 return im->icon; | |
1601 } | |
1602 | |
1603 void | |
1576 gaim_im_set_typing_state(GaimIm *im, int state) | 1604 gaim_im_set_typing_state(GaimIm *im, int state) |
1577 { | 1605 { |
1578 g_return_if_fail(im != NULL); | 1606 g_return_if_fail(im != NULL); |
1579 | 1607 |
1580 im->typing_state = state; | 1608 im->typing_state = state; |
2585 void | 2613 void |
2586 gaim_conversations_init(void) | 2614 gaim_conversations_init(void) |
2587 { | 2615 { |
2588 void *handle = gaim_conversations_get_handle(); | 2616 void *handle = gaim_conversations_get_handle(); |
2589 | 2617 |
2590 /* Register preferences */ | 2618 /********************************************************************** |
2619 * Register preferences | |
2620 **********************************************************************/ | |
2591 | 2621 |
2592 /* Conversations */ | 2622 /* Conversations */ |
2593 gaim_prefs_add_none("/core/conversations"); | 2623 gaim_prefs_add_none("/core/conversations"); |
2594 gaim_prefs_add_bool("/core/conversations/send_urls_as_links", TRUE); | 2624 gaim_prefs_add_bool("/core/conversations/send_urls_as_links", TRUE); |
2595 gaim_prefs_add_bool("/core/conversations/away_back_on_send", TRUE); | 2625 gaim_prefs_add_bool("/core/conversations/away_back_on_send", TRUE); |
2615 update_titles_pref_cb, NULL); | 2645 update_titles_pref_cb, NULL); |
2616 gaim_prefs_connect_callback("/core/buddies/use_server_alias", | 2646 gaim_prefs_connect_callback("/core/buddies/use_server_alias", |
2617 update_titles_pref_cb, NULL); | 2647 update_titles_pref_cb, NULL); |
2618 | 2648 |
2619 | 2649 |
2620 /* Register signals */ | 2650 /********************************************************************** |
2651 * Register signals | |
2652 **********************************************************************/ | |
2621 gaim_signal_register(handle, "displaying-im-msg", | 2653 gaim_signal_register(handle, "displaying-im-msg", |
2622 gaim_marshal_BOOLEAN__POINTER_POINTER_POINTER, | 2654 gaim_marshal_BOOLEAN__POINTER_POINTER_POINTER, |
2623 gaim_value_new(GAIM_TYPE_BOOLEAN), 3, | 2655 gaim_value_new(GAIM_TYPE_BOOLEAN), 3, |
2624 gaim_value_new(GAIM_TYPE_SUBTYPE, | 2656 gaim_value_new(GAIM_TYPE_SUBTYPE, |
2625 GAIM_SUBTYPE_ACCOUNT), | 2657 GAIM_SUBTYPE_ACCOUNT), |