comparison src/protocols/yahoo/yahoo_filexfer.c @ 13849:8d1c55309e3c

[gaim-migrate @ 16306] Keep track of the Yahoo! IMVironment specified by the people we're IMing with. When we reply to their IMs, we now send the same IMVironment instead of always sending an empty IMVironment because sending an empty IMVironment would reset their IMVironment back to nothing. This shouldn't negatively affect the Doodle stuff... but it didn't work for me when I tested it, so it's hard to tell. This is a change I made while at Meebo committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Thu, 22 Jun 2006 06:26:38 +0000
parents 967ef719cb62
children b7e4180af1db
comparison
equal deleted inserted replaced
13848:b43971b34053 13849:8d1c55309e3c
479 { 479 {
480 char *from = NULL; 480 char *from = NULL;
481 char *to = NULL; 481 char *to = NULL;
482 char *msg = NULL; 482 char *msg = NULL;
483 char *url = NULL; 483 char *url = NULL;
484 char *imv = NULL;
484 long expires = 0; 485 long expires = 0;
485 GaimXfer *xfer; 486 GaimXfer *xfer;
487 struct yahoo_data *yd;
486 struct yahoo_xfer_data *xfer_data; 488 struct yahoo_xfer_data *xfer_data;
487 char *service = NULL; 489 char *service = NULL;
488 char *filename = NULL; 490 char *filename = NULL;
489 unsigned long filesize = 0L; 491 unsigned long filesize = 0L;
490 GSList *l; 492 GSList *l;
493
494 yd = gc->proto_data;
491 495
492 for (l = pkt->hash; l; l = l->next) { 496 for (l = pkt->hash; l; l = l->next) {
493 struct yahoo_pair *pair = l->data; 497 struct yahoo_pair *pair = l->data;
494 498
495 if (pair->key == 4) 499 if (pair->key == 4)
506 filename = pair->value; 510 filename = pair->value;
507 if (pair->key == 28) 511 if (pair->key == 28)
508 filesize = atol(pair->value); 512 filesize = atol(pair->value);
509 if (pair->key == 49) 513 if (pair->key == 49)
510 service = pair->value; 514 service = pair->value;
515 if (pair->key == 63)
516 imv = pair->value;
517 }
518
519 /*
520 * The remote user has changed their IMVironment. We
521 * record it for later use.
522 */
523 if (from && imv && service && (strcmp("IMVIRONMENT", service) == 0)) {
524 g_hash_table_replace(yd->imvironments, g_strdup(from), g_strdup(imv));
525 return;
511 } 526 }
512 527
513 if (pkt->service == YAHOO_SERVICE_P2PFILEXFER) { 528 if (pkt->service == YAHOO_SERVICE_P2PFILEXFER) {
514 if (service && (strcmp("FILEXFER", service) != 0)) { 529 if (service && (strcmp("FILEXFER", service) != 0)) {
515 gaim_debug_misc("yahoo", "unhandled service 0x%02x\n", pkt->service); 530 gaim_debug_misc("yahoo", "unhandled service 0x%02x\n", pkt->service);