static void waprpl_set_buddy_icon(PurpleConnection * gc, PurpleStoredImage * img) { /* Send the picture the user has selected! */ whatsapp_connection *wconn = purple_connection_get_protocol_data(gc); size_t size = purple_imgstore_get_size(img); const void *data = purple_imgstore_get_data(img); if (data) { // First of all make the picture a square char * sqbuffer; int sqsize; imgProfile(data, size, (void**)&sqbuffer, &sqsize, 640); char * pbuffer; int osize; imgProfile(data, size, (void**)&pbuffer, &osize, 96); waAPI_setavatar(wconn->waAPI, sqbuffer, sqsize, pbuffer, osize); free(sqbuffer); free(pbuffer); } else { waAPI_setavatar(wconn->waAPI, 0,0,0,0); } waprpl_check_output(gc); }
static void waprpl_set_buddy_icon(PurpleConnection *gc, PurpleStoredImage *img) { // Send the picture the user has selected! whatsapp_connection * wconn = purple_connection_get_protocol_data(gc); size_t size = purple_imgstore_get_size(img); const void * data = purple_imgstore_get_data(img); waAPI_setavatar(wconn->waAPI, data, size); waprpl_check_output(gc); }