comparison src/protocols/yahoo/yahoo_filexfer.c @ 11914:2219f4bf4a57

[gaim-migrate @ 14205] SF Patch #1342017 from sadrul "This patch allows a user to change brush color during the doodle-session. This patch is mostly a rough one to get an idea whether the approach is correct. To make things simple, I have kept brush_size and brush_color in GaimGtkWhiteboard, although it's there in doodle_session. It could be in either place, although I would think it's best to be in GaimGtkWhiteboard because any/most implementations of doodle-ing would have these attributes. So keeping them within the prpl may not be the best option? Anyway, considering the brush-size and color stay at the prpl for now, I have introduced two functions in GaimWhiteboardPrplOps to get/set the size and color of the brush from the prpl. rekkanoryo (using Y! 7) and I (using gaim) have tested this, and it seemed to work OK." Plus, I cleaned up a whole bunch of code. My apologies for this all being committed together, but it was a case of "Oh, this will be quick." that lead into hours of making intertwined changes. committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Mon, 31 Oct 2005 02:19:51 +0000
parents a1aa681f1448
children cbebda5f019c
comparison
equal deleted inserted replaced
11913:b3105d119a17 11914:2219f4bf4a57
343 if (xfer_data) 343 if (xfer_data)
344 yahoo_xfer_data_free(xfer_data); 344 yahoo_xfer_data_free(xfer_data);
345 xfer->data = NULL; 345 xfer->data = NULL;
346 } 346 }
347 347
348 void yahoo_process_p2pfilexfer( GaimConnection *gc, struct yahoo_packet *pkt ) 348 void yahoo_process_p2pfilexfer(GaimConnection *gc, struct yahoo_packet *pkt)
349 { 349 {
350 GSList *l = pkt->hash; 350 GSList *l = pkt->hash;
351 351
352 char *me = NULL; 352 char *me = NULL;
353 char *from = NULL; 353 char *from = NULL;
354 char *service = NULL; 354 char *service = NULL;
355 char *message = NULL; 355 char *message = NULL;
356 char *command = NULL; 356 char *command = NULL;
357 char *imv = NULL; 357 char *imv = NULL;
358 char *unknown = NULL; 358 char *unknown = NULL;
359 359
360 /* Get all the necessary values from this new packet */ 360 /* Get all the necessary values from this new packet */
361 while( l ) 361 while(l != NULL)
362 { 362 {
363 struct yahoo_pair *pair = l->data; 363 struct yahoo_pair *pair = l->data;
364 364
365 if( pair->key == 5 ) /* Get who the packet is for */ 365 if(pair->key == 5) /* Get who the packet is for */
366 me = pair->value; 366 me = pair->value;
367 367
368 if( pair->key == 4 ) /* Get who the packet is from */ 368 if(pair->key == 4) /* Get who the packet is from */
369 from = pair->value; 369 from = pair->value;
370 370
371 if( pair->key == 49 ) /* Get the type of service */ 371 if(pair->key == 49) /* Get the type of service */
372 service = pair->value; 372 service = pair->value;
373 373
374 if( pair->key == 14 ) /* Get the 'message' of the packet */ 374 if(pair->key == 14) /* Get the 'message' of the packet */
375 message = pair->value; 375 message = pair->value;
376 376
377 if( pair->key == 13 ) /* Get the command associated with this packet */ 377 if(pair->key == 13) /* Get the command associated with this packet */
378 command = pair->value; 378 command = pair->value;
379 379
380 if( pair->key == 63 ) /* IMVironment name and version */ 380 if(pair->key == 63) /* IMVironment name and version */
381 imv = pair->value; 381 imv = pair->value;
382 382
383 if( pair->key == 64 ) /* Not sure, but it does vary with initialization of Doodle */ 383 if(pair->key == 64) /* Not sure, but it does vary with initialization of Doodle */
384 unknown = pair->value; /* So, I'll keep it (for a little while atleast) */ 384 unknown = pair->value; /* So, I'll keep it (for a little while atleast) */
385 385
386 l = l->next; 386 l = l->next;
387 } 387 }
388 388
389 /* If this packet is an IMVIRONMENT, handle it accordingly */ 389 /* If this packet is an IMVIRONMENT, handle it accordingly */
390 if( !strcmp( service, "IMVIRONMENT" ) ) 390 if(!strcmp(service, "IMVIRONMENT"))
391 { 391 {
392 /* Check for a Doodle packet and handle it accordingly */ 392 /* Check for a Doodle packet and handle it accordingly */
393 if( !strcmp( imv, "doodle;11" ) ) 393 if(!strcmp(imv, "doodle;11"))
394 yahoo_doodle_process( gc, me, from, command, message ); 394 yahoo_doodle_process(gc, me, from, command, message);
395 395
396 /* If an IMVIRONMENT packet comes without a specific imviroment name */ 396 /* If an IMVIRONMENT packet comes without a specific imviroment name */
397 if( !strcmp( imv, ";0" ) ) 397 if(!strcmp(imv, ";0"))
398 { 398 {
399 /* It is unfortunately time to close all IMVironments with remote 399 /* It is unfortunately time to close all IMVironments with the remote client */
400 * client 400 yahoo_doodle_command_got_shutdown(gc, from);
401 */
402 yahoo_doodle_command_got_shutdown( gc, from );
403 } 401 }
404 } 402 }
405 } 403 }
406 404
407 void yahoo_process_filetransfer(GaimConnection *gc, struct yahoo_packet *pkt) 405 void yahoo_process_filetransfer(GaimConnection *gc, struct yahoo_packet *pkt)
531 gaim_xfer_set_cancel_recv_fnc(xfer, yahoo_xfer_cancel_recv); 529 gaim_xfer_set_cancel_recv_fnc(xfer, yahoo_xfer_cancel_recv);
532 gaim_xfer_set_read_fnc(xfer, yahoo_xfer_read); 530 gaim_xfer_set_read_fnc(xfer, yahoo_xfer_read);
533 gaim_xfer_set_write_fnc(xfer, yahoo_xfer_write); 531 gaim_xfer_set_write_fnc(xfer, yahoo_xfer_write);
534 532
535 /* Now perform the request */ 533 /* Now perform the request */
536 if (file) 534 if (file)
537 gaim_xfer_request_accepted(xfer, file); 535 gaim_xfer_request_accepted(xfer, file);
538 else 536 else
539 gaim_xfer_request(xfer); 537 gaim_xfer_request(xfer);
540 } 538 }