libpurple/buddyicon.c

changeset 40885
87f6241da196
parent 40853
d3518ff99fa7
child 40889
00c77e22fb64
equal deleted inserted replaced
40884:ca31392953ed 40885:87f6241da196
376 } 376 }
377 377
378 void 378 void
379 purple_buddy_icon_update(PurpleBuddyIcon *icon) 379 purple_buddy_icon_update(PurpleBuddyIcon *icon)
380 { 380 {
381 PurpleIMConversation *im; 381 PurpleConversation *im;
382 PurpleAccount *account; 382 PurpleAccount *account;
383 const char *username; 383 const char *username;
384 PurpleBuddyIcon *icon_to_set; 384 PurpleBuddyIcon *icon_to_set;
385 GSList *buddies; 385 GSList *buddies;
386 386
439 439
440 buddies = g_slist_delete_link(buddies, buddies); 440 buddies = g_slist_delete_link(buddies, buddies);
441 } 441 }
442 442
443 im = purple_conversations_find_im_with_account(username, account); 443 im = purple_conversations_find_im_with_account(username, account);
444 444 if(PURPLE_IS_IM_CONVERSATION(im)) {
445 if (im != NULL) 445 purple_im_conversation_set_icon(PURPLE_IM_CONVERSATION(im),
446 purple_im_conversation_set_icon(im, icon_to_set); 446 icon_to_set);
447 }
447 448
448 /* icon's refcount was incremented above */ 449 /* icon's refcount was incremented above */
449 purple_buddy_icon_unref(icon); 450 purple_buddy_icon_unref(icon);
450 } 451 }
451 452
912 for (child = purple_blist_node_get_first_child(node); 913 for (child = purple_blist_node_get_first_child(node);
913 child; 914 child;
914 child = purple_blist_node_get_sibling_next(child)) 915 child = purple_blist_node_get_sibling_next(child))
915 { 916 {
916 PurpleBuddy *buddy; 917 PurpleBuddy *buddy;
917 PurpleIMConversation *im; 918 PurpleConversation *im;
918 919
919 if (!PURPLE_IS_BUDDY(child)) 920 if (!PURPLE_IS_BUDDY(child))
920 continue; 921 continue;
921 922
922 buddy = (PurpleBuddy *)child; 923 buddy = (PurpleBuddy *)child;
923 924
924 im = purple_conversations_find_im_with_account(purple_buddy_get_name(buddy), purple_buddy_get_account(buddy)); 925 im = purple_conversations_find_im_with_account(purple_buddy_get_name(buddy), purple_buddy_get_account(buddy));
925 if (im) 926 if (im)
926 purple_conversation_update(PURPLE_CONVERSATION(im), PURPLE_CONVERSATION_UPDATE_ICON); 927 purple_conversation_update(im, PURPLE_CONVERSATION_UPDATE_ICON);
927 928
928 /* Is this call necessary anymore? Can the buddies 929 /* Is this call necessary anymore? Can the buddies
929 * themselves need updating when the custom buddy 930 * themselves need updating when the custom buddy
930 * icon changes? */ 931 * icon changes? */
931 purple_blist_update_node(purple_blist_get_default(), 932 purple_blist_update_node(purple_blist_get_default(),
932 PURPLE_BLIST_NODE(buddy)); 933 PURPLE_BLIST_NODE(buddy));
933 } 934 }
934 } else if (PURPLE_IS_CHAT(node)) { 935 } else if (PURPLE_IS_CHAT(node)) {
935 PurpleChatConversation *chat = NULL; 936 PurpleConversation *chat = NULL;
936 937
937 chat = purple_conversations_find_chat_with_account(purple_chat_get_name((PurpleChat*)node), purple_chat_get_account((PurpleChat*)node)); 938 chat = purple_conversations_find_chat_with_account(purple_chat_get_name((PurpleChat*)node), purple_chat_get_account((PurpleChat*)node));
938 if (chat) { 939 if (chat) {
939 purple_conversation_update(PURPLE_CONVERSATION(chat), PURPLE_CONVERSATION_UPDATE_ICON); 940 purple_conversation_update(chat, PURPLE_CONVERSATION_UPDATE_ICON);
940 } 941 }
941 } 942 }
942 943
943 purple_blist_update_node(purple_blist_get_default(), node); 944 purple_blist_update_node(purple_blist_get_default(), node);
944 945

mercurial