@@ -364,11 +364,15 @@ void on_file_recv_control(Tox *tox, uint32_t friendnumber, uint32_t filenumber,
364364}
365365
366366void on_file_recv (Tox * tox , uint32_t friendnumber , uint32_t filenumber , uint32_t kind , uint64_t file_size ,
367- const uint8_t * filename , size_t filename_length , void * userdata )
367+ const uint8_t * string , size_t length , void * userdata )
368368{
369369 Toxic * toxic = (Toxic * ) userdata ;
370370 Windows * windows = toxic -> windows ;
371371
372+ char filename [MAX_STR_SIZE + 1 ];
373+ length = copy_tox_str (filename , sizeof (filename ), (const char * ) string , length );
374+ filter_string (filename , length , false);
375+
372376 /* We don't care about receiving avatars */
373377 if (kind != TOX_FILE_KIND_DATA ) {
374378 tox_file_control (tox , friendnumber , filenumber , TOX_FILE_CONTROL_CANCEL , NULL );
@@ -379,8 +383,7 @@ void on_file_recv(Tox *tox, uint32_t friendnumber, uint32_t filenumber, uint32_t
379383 ToxWindow * w = windows -> list [i ];
380384
381385 if (w -> onFileRecv != NULL ) {
382- w -> onFileRecv (w , toxic , friendnumber , filenumber , file_size , (const char * ) filename ,
383- filename_length );
386+ w -> onFileRecv (w , toxic , friendnumber , filenumber , file_size , filename , length );
384387 }
385388 }
386389}
0 commit comments