| 2166 purple_debug_info( MXIT_PLUGIN_ID, "updating avatar for contact '%s'\n", chunk.mxitid ); |
2166 purple_debug_info( MXIT_PLUGIN_ID, "updating avatar for contact '%s'\n", chunk.mxitid ); |
| 2167 |
2167 |
| 2168 contact = get_mxit_invite_contact( session, chunk.mxitid ); |
2168 contact = get_mxit_invite_contact( session, chunk.mxitid ); |
| 2169 if ( contact ) { |
2169 if ( contact ) { |
| 2170 /* this is an invite (add image to the internal image store) */ |
2170 /* this is an invite (add image to the internal image store) */ |
| 2171 contact->imgid = purple_imgstore_add_with_id( chunk.data, chunk.length, NULL ); |
2171 contact->imgid = purple_imgstore_add_with_id( g_memdup( chunk.data, chunk.length ), chunk.length, NULL ); |
| 2172 /* show the profile */ |
2172 /* show the profile */ |
| 2173 mxit_show_profile( session, chunk.mxitid, contact->profile ); |
2173 mxit_show_profile( session, chunk.mxitid, contact->profile ); |
| 2174 } |
2174 } |
| 2175 else { |
2175 else { |
| 2176 /* this is a contact's avatar, so update it */ |
2176 /* this is a contact's avatar, so update it */ |
| 2177 purple_buddy_icons_set_for_user( session->acc, chunk.mxitid, g_memdup( chunk.data, chunk.length), chunk.length, chunk.avatarid ); |
2177 purple_buddy_icons_set_for_user( session->acc, chunk.mxitid, g_memdup( chunk.data, chunk.length ), chunk.length, chunk.avatarid ); |
| 2178 } |
2178 } |
| 2179 } |
2179 } |
| 2180 } |
2180 } |
| 2181 break; |
2181 break; |
| 2182 |
2182 |