comparison src/gtkconv.c @ 14138:7f276f375789

[gaim-migrate @ 16780] Merges r16472-16568 from blist-efficiency into trunk. committer: Tailor Script <tailor@pidgin.im>
author Aaron Sheldon <aaronsheldon>
date Wed, 16 Aug 2006 04:50:27 +0000
parents 8bda65b88e49
children ff3db5cdeb9f
comparison
equal deleted inserted replaced
14137:7a763d1d1df6 14138:7f276f375789
2183 gaim_gtkconv_get_tab_icon(GaimConversation *conv, gboolean small_icon) 2183 gaim_gtkconv_get_tab_icon(GaimConversation *conv, gboolean small_icon)
2184 { 2184 {
2185 GaimAccount *account = NULL; 2185 GaimAccount *account = NULL;
2186 const char *name = NULL; 2186 const char *name = NULL;
2187 GdkPixbuf *status = NULL; 2187 GdkPixbuf *status = NULL;
2188 GaimBlistUiOps *ops = gaim_blist_get_ui_ops();
2188 2189
2189 g_return_val_if_fail(conv != NULL, NULL); 2190 g_return_val_if_fail(conv != NULL, NULL);
2190 2191
2191 account = gaim_conversation_get_account(conv); 2192 account = gaim_conversation_get_account(conv);
2192 name = gaim_conversation_get_name(conv); 2193 name = gaim_conversation_get_name(conv);
2196 2197
2197 /* Use the buddy icon, if possible */ 2198 /* Use the buddy icon, if possible */
2198 if (gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_IM) { 2199 if (gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_IM) {
2199 GaimBuddy *b = gaim_find_buddy(account, name); 2200 GaimBuddy *b = gaim_find_buddy(account, name);
2200 if (b != NULL) { 2201 if (b != NULL) {
2202 /* I hate this hack. It fixes a bug where the pending message icon
2203 * displays in the conv tab even though it shouldn't.
2204 * A better solution would be great. */
2205 if (ops && ops->update)
2206 ops->update(NULL, (GaimBlistNode*)b);
2207
2201 status = gaim_gtk_blist_get_status_icon((GaimBlistNode*)b, 2208 status = gaim_gtk_blist_get_status_icon((GaimBlistNode*)b,
2202 (small_icon ? GAIM_STATUS_ICON_SMALL : GAIM_STATUS_ICON_LARGE)); 2209 (small_icon ? GAIM_STATUS_ICON_SMALL : GAIM_STATUS_ICON_LARGE));
2203 } 2210 }
2204 } 2211 }
2205 2212
6339 /* In case a conversation is started after the buddy has signed-on/off */ 6346 /* In case a conversation is started after the buddy has signed-on/off */
6340 g_timeout_add(11000, (GSourceFunc)update_buddy_status_timeout, buddy); 6347 g_timeout_add(11000, (GSourceFunc)update_buddy_status_timeout, buddy);
6341 } 6348 }
6342 6349
6343 static void 6350 static void
6351 update_buddy_privacy_changed(GaimBuddy *buddy)
6352 {
6353 GaimGtkConversation *gtkconv;
6354 GaimConversation *conv;
6355
6356 gtkconv = get_gtkconv_with_contact(gaim_buddy_get_contact(buddy));
6357 if (gtkconv)
6358 {
6359 conv = gtkconv->active_conv;
6360 gaim_gtkconv_update_fields(conv, GAIM_GTKCONV_TAB_ICON);
6361 }
6362 }
6363
6364 static void
6344 update_buddy_idle_changed(GaimBuddy *buddy, gboolean old, gboolean newidle) 6365 update_buddy_idle_changed(GaimBuddy *buddy, gboolean old, gboolean newidle)
6345 { 6366 {
6346 GaimConversation *conv; 6367 GaimConversation *conv;
6347 6368
6348 conv = gaim_find_conversation_with_account(GAIM_CONV_TYPE_IM, buddy->name, buddy->account); 6369 conv = gaim_find_conversation_with_account(GAIM_CONV_TYPE_IM, buddy->name, buddy->account);
6626 handle, GAIM_CALLBACK(update_buddy_sign), "on"); 6647 handle, GAIM_CALLBACK(update_buddy_sign), "on");
6627 gaim_signal_connect(blist_handle, "buddy-signed-off", 6648 gaim_signal_connect(blist_handle, "buddy-signed-off",
6628 handle, GAIM_CALLBACK(update_buddy_sign), "off"); 6649 handle, GAIM_CALLBACK(update_buddy_sign), "off");
6629 gaim_signal_connect(blist_handle, "buddy-status-changed", 6650 gaim_signal_connect(blist_handle, "buddy-status-changed",
6630 handle, GAIM_CALLBACK(update_buddy_status_changed), NULL); 6651 handle, GAIM_CALLBACK(update_buddy_status_changed), NULL);
6652 gaim_signal_connect(blist_handle, "buddy-privacy-changed",
6653 handle, GAIM_CALLBACK(update_buddy_privacy_changed), NULL);
6631 gaim_signal_connect(blist_handle, "buddy-idle-changed", 6654 gaim_signal_connect(blist_handle, "buddy-idle-changed",
6632 handle, GAIM_CALLBACK(update_buddy_idle_changed), NULL); 6655 handle, GAIM_CALLBACK(update_buddy_idle_changed), NULL);
6633 gaim_signal_connect(blist_handle, "buddy-icon-changed", 6656 gaim_signal_connect(blist_handle, "buddy-icon-changed",
6634 handle, GAIM_CALLBACK(update_buddy_icon), NULL); 6657 handle, GAIM_CALLBACK(update_buddy_icon), NULL);
6635 gaim_signal_connect(gaim_conversations_get_handle(), "buddy-typing", 6658 gaim_signal_connect(gaim_conversations_get_handle(), "buddy-typing",