comparison libpurple/protocols/mxit/protocol.c @ 32507:5d81b452dcc4

Need to make a copy of the data passed to purple_imgstore_add_with_id().
author andrew.victor@mxit.com
date Sat, 03 Sep 2011 15:11:20 +0000
parents 323876c34a96
children 904686722499
comparison
equal deleted inserted replaced
32506:cadc8dfafbaf 32507:5d81b452dcc4
2134 purple_debug_info( MXIT_PLUGIN_ID, "updating avatar for contact '%s'\n", chunk.mxitid ); 2134 purple_debug_info( MXIT_PLUGIN_ID, "updating avatar for contact '%s'\n", chunk.mxitid );
2135 2135
2136 contact = get_mxit_invite_contact( session, chunk.mxitid ); 2136 contact = get_mxit_invite_contact( session, chunk.mxitid );
2137 if ( contact ) { 2137 if ( contact ) {
2138 /* this is an invite (add image to the internal image store) */ 2138 /* this is an invite (add image to the internal image store) */
2139 contact->imgid = purple_imgstore_add_with_id( chunk.data, chunk.length, NULL ); 2139 contact->imgid = purple_imgstore_add_with_id( g_memdup( chunk.data, chunk.length ), chunk.length, NULL );
2140 /* show the profile */ 2140 /* show the profile */
2141 mxit_show_profile( session, chunk.mxitid, contact->profile ); 2141 mxit_show_profile( session, chunk.mxitid, contact->profile );
2142 } 2142 }
2143 else { 2143 else {
2144 /* this is a contact's avatar, so update it */ 2144 /* this is a contact's avatar, so update it */
2145 purple_buddy_icons_set_for_user( session->acc, chunk.mxitid, g_memdup( chunk.data, chunk.length), chunk.length, chunk.avatarid ); 2145 purple_buddy_icons_set_for_user( session->acc, chunk.mxitid, g_memdup( chunk.data, chunk.length ), chunk.length, chunk.avatarid );
2146 } 2146 }
2147 } 2147 }
2148 } 2148 }
2149 break; 2149 break;
2150 2150