comparison src/toc.c @ 196:3042e11c1902

[gaim-migrate @ 206] Figured out some UUID's, and prepared for their eventual implementation. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Sun, 30 Apr 2000 00:34:14 +0000
parents d7690984c0f1
children 24f0fef56a73
comparison
equal deleted inserted replaced
195:a82e9f91a6fc 196:3042e11c1902
170 170
171 171
172 g_snprintf(buf2, sizeof(buf2), "toc_init_done"); 172 g_snprintf(buf2, sizeof(buf2), "toc_init_done");
173 sflap_send(buf2, -1, TYPE_DATA); 173 sflap_send(buf2, -1, TYPE_DATA);
174 174
175 g_snprintf(buf2, sizeof(buf2), "toc_set_caps %s", 175 g_snprintf(buf2, sizeof(buf2), "toc_set_caps %s %s",
176 FILETRANS_UID); 176 FILE_SEND_UID, FILE_GET_UID);
177 sflap_send(buf2, -1, TYPE_DATA); 177 sflap_send(buf2, -1, TYPE_DATA);
178 178
179 serv_finish_login(); 179 serv_finish_login();
180 return 0; 180 return 0;
181 } 181 }
578 578
579 serv_got_chat_invite(name, id, who, message); 579 serv_got_chat_invite(name, id, who, message);
580 580
581 581
582 } else if (!strcasecmp(c, "RVOUS_PROPOSE")) { 582 } else if (!strcasecmp(c, "RVOUS_PROPOSE")) {
583 /* File trans. Yummy. */
584 char *user; 583 char *user;
585 char *uuid; 584 char *uuid;
586 char *cookie; 585 char *cookie;
587 int seq; 586 int seq;
588 char *rip, *pip, *vip; 587 char *rip, *pip, *vip;
612 messages[i] = frombase64(strtok(NULL, ":")); 611 messages[i] = frombase64(strtok(NULL, ":"));
613 } 612 }
614 613
615 tmp = frombase64(strtok(NULL, ":")); 614 tmp = frombase64(strtok(NULL, ":"));
616 615
617 subtype = tmp[1]; 616 if (!strcmp(uuid, FILE_GET_UID)) {
618 files = tmp[3]; /* These are fine */ 617 /* we're getting a file */
619 618 subtype = tmp[1];
620 temp = tmp[4]; 619 files = tmp[3]; /* These are fine */
621 temp <<= 24; 620
622 temp &= 0xff000000; 621 totalsize = 0;
623 totalsize = temp; 622 totalsize |= (tmp[4] << 24) & 0xff000000;
624 temp = tmp[5]; 623 totalsize |= (tmp[5] << 16) & 0x00ff0000;
625 temp <<= 16; 624 totalsize |= (tmp[6] << 8) & 0x0000ff00;
626 temp &= 0x00ff0000; 625 totalsize |= (tmp[7] << 0) & 0x000000ff;
627 totalsize |= temp; 626
628 temp = tmp[6]; 627 name = tmp + 8;
629 temp <<= 8; 628
630 temp &= 0x0000ff00; 629 ft = g_new0(struct file_transfer, 1);
631 totalsize |= temp; 630
632 temp = tmp[7]; 631 ft->cookie = frombase64(cookie);
633 temp &= 0x000000ff; 632 ft->ip = g_strdup(pip);
634 totalsize |= temp; 633 ft->port = port;
635 634 if (i)
636 name = tmp + 8; 635 ft->message = g_strdup(messages[0]);
637 636 else
638 ft = g_new0(struct file_transfer, 1); 637 ft->message = NULL;
639 638 ft->filename = g_strdup(name);
640 ft->cookie = frombase64(cookie); 639 ft->user = g_strdup(user);
641 ft->ip = g_strdup(pip); 640 ft->size = totalsize;
642 ft->port = port;
643 if (i)
644 ft->message = g_strdup(messages[0]);
645 else
646 ft->message = NULL;
647 ft->filename = g_strdup(name);
648 ft->user = g_strdup(user);
649 ft->size = totalsize;
650 641
651 g_free(tmp); 642 g_free(tmp);
652 643
653 for (i--; i >= 0; i--) 644 for (i--; i >= 0; i--)
654 g_free(messages[i]); 645 g_free(messages[i]);
655 646
656 accept_file_dialog(ft); 647 accept_file_dialog(ft);
648 } else if (!strcmp(uuid, FILE_SEND_UID)) {
649 /* we're sending a file */
650 /* FIXME */
651 /* here's what needs to happen:
652 * 1. dialog to accept/reject transfer
653 * 2. if cancel, toc_rvous_cancel
654 * 3. if accept, first open a socket, then accept
655 * a. on connect, send header
656 * b. wait for header
657 * c. send file
658 * d. wait for info
659 */
660 /*
661 } else if (!strcmp(uuid, VOICE_UID)) {
662 } else if (!strcmp(uuid, B_ICON_UID)) {
663 } else if (!strcmp(uuid, IMAGE_UID)) {
664 */
665
666 } else {
667 sprintf(debug_buff,"don't know what to do with %s\n",
668 uuid);
669 debug_print(debug_buff);
670 }
657 } else { 671 } else {
658 sprintf(debug_buff,"don't know what to do with %s\n", c); 672 sprintf(debug_buff,"don't know what to do with %s\n", c);
659 debug_print(debug_buff); 673 debug_print(debug_buff);
660 } 674 }
661 g_free(buf); 675 g_free(buf);