| 846 guchar *icon_data, size_t icon_len) |
846 guchar *icon_data, size_t icon_len) |
| 847 { |
847 { |
| 848 char *old_icon; |
848 char *old_icon; |
| 849 PurpleImage *old_img; |
849 PurpleImage *old_img; |
| 850 PurpleImage *img = NULL; |
850 PurpleImage *img = NULL; |
| 851 PurpleBlistUiOps *ops = purple_blist_get_ui_ops(); |
|
| 852 |
851 |
| 853 g_return_val_if_fail(node != NULL, NULL); |
852 g_return_val_if_fail(node != NULL, NULL); |
| 854 |
853 |
| 855 if (!PURPLE_IS_CONTACT(node) && |
854 if (!PURPLE_IS_CONTACT(node) && |
| 856 !PURPLE_IS_CHAT(node) && |
855 !PURPLE_IS_CHAT(node) && |
| 901 purple_conversation_update(PURPLE_CONVERSATION(im), PURPLE_CONVERSATION_UPDATE_ICON); |
900 purple_conversation_update(PURPLE_CONVERSATION(im), PURPLE_CONVERSATION_UPDATE_ICON); |
| 902 |
901 |
| 903 /* Is this call necessary anymore? Can the buddies |
902 /* Is this call necessary anymore? Can the buddies |
| 904 * themselves need updating when the custom buddy |
903 * themselves need updating when the custom buddy |
| 905 * icon changes? */ |
904 * icon changes? */ |
| 906 if (ops && ops->update) { |
905 purple_blist_update_node(purple_blist_get_default(), |
| 907 ops->update(purple_blist_get_default(), |
906 PURPLE_BLIST_NODE(buddy)); |
| 908 PURPLE_BLIST_NODE(buddy)); |
|
| 909 } |
|
| 910 } |
907 } |
| 911 } else if (PURPLE_IS_CHAT(node)) { |
908 } else if (PURPLE_IS_CHAT(node)) { |
| 912 PurpleChatConversation *chat = NULL; |
909 PurpleChatConversation *chat = NULL; |
| 913 |
910 |
| 914 chat = purple_conversations_find_chat_with_account(purple_chat_get_name((PurpleChat*)node), purple_chat_get_account((PurpleChat*)node)); |
911 chat = purple_conversations_find_chat_with_account(purple_chat_get_name((PurpleChat*)node), purple_chat_get_account((PurpleChat*)node)); |
| 915 if (chat) { |
912 if (chat) { |
| 916 purple_conversation_update(PURPLE_CONVERSATION(chat), PURPLE_CONVERSATION_UPDATE_ICON); |
913 purple_conversation_update(PURPLE_CONVERSATION(chat), PURPLE_CONVERSATION_UPDATE_ICON); |
| 917 } |
914 } |
| 918 } |
915 } |
| 919 |
916 |
| 920 if (ops && ops->update) { |
917 purple_blist_update_node(purple_blist_get_default(), node); |
| 921 ops->update(purple_blist_get_default(), node); |
|
| 922 } |
|
| 923 |
918 |
| 924 if (old_img) { |
919 if (old_img) { |
| 925 g_object_unref(old_img); |
920 g_object_unref(old_img); |
| 926 } else if (old_icon) { |
921 } else if (old_icon) { |
| 927 /* The old icon may not have been loaded into memory. In that |
922 /* The old icon may not have been loaded into memory. In that |