Mercurial > pidgin
comparison src/toc.c @ 194:d7690984c0f1
[gaim-migrate @ 204]
File Transfer is almost done, it's just the little bugs now.
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Sat, 29 Apr 2000 12:56:55 +0000 |
parents | 9d684979f507 |
children | 3042e11c1902 |
comparison
equal
deleted
inserted
replaced
193:6af9b88e4f90 | 194:d7690984c0f1 |
---|---|
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 #if 0 | |
176 g_snprintf(buf2, sizeof(buf2), "toc_set_caps %s", | 175 g_snprintf(buf2, sizeof(buf2), "toc_set_caps %s", |
177 FILETRANS_UID); | 176 FILETRANS_UID); |
178 sflap_send(buf2, -1, TYPE_DATA); | 177 sflap_send(buf2, -1, TYPE_DATA); |
179 #endif | |
180 | 178 |
181 serv_finish_login(); | 179 serv_finish_login(); |
182 return 0; | 180 return 0; |
183 } | 181 } |
184 | 182 |
579 message = strtok(NULL, ":"); | 577 message = strtok(NULL, ":"); |
580 | 578 |
581 serv_got_chat_invite(name, id, who, message); | 579 serv_got_chat_invite(name, id, who, message); |
582 | 580 |
583 | 581 |
584 #if 0 | |
585 } else if (!strcasecmp(c, "RVOUS_PROPOSE")) { | 582 } else if (!strcasecmp(c, "RVOUS_PROPOSE")) { |
586 /* File trans. Yummy. */ | 583 /* File trans. Yummy. */ |
587 char *user; | 584 char *user; |
588 char *uuid; | 585 char *uuid; |
589 char *cookie; | 586 char *cookie; |
591 char *rip, *pip, *vip; | 588 char *rip, *pip, *vip; |
592 int port; | 589 int port; |
593 int unk[4]; | 590 int unk[4]; |
594 char *messages[4]; | 591 char *messages[4]; |
595 int subtype, files, totalsize; | 592 int subtype, files, totalsize; |
593 int temp; | |
596 char *name; | 594 char *name; |
597 char *tmp; | 595 char *tmp; |
598 int i; | 596 int i; |
599 struct file_transfer *ft; | 597 struct file_transfer *ft; |
600 | 598 |
617 tmp = frombase64(strtok(NULL, ":")); | 615 tmp = frombase64(strtok(NULL, ":")); |
618 | 616 |
619 subtype = tmp[1]; | 617 subtype = tmp[1]; |
620 files = tmp[3]; /* These are fine */ | 618 files = tmp[3]; /* These are fine */ |
621 | 619 |
622 totalsize = (tmp[4] << 24 & 0xff) | | 620 temp = tmp[4]; |
623 (tmp[5] << 16 & 0xff) | | 621 temp <<= 24; |
624 (tmp[6] << 8 & 0xff) | | 622 temp &= 0xff000000; |
625 (tmp[7] & 0xff); | 623 totalsize = temp; |
624 temp = tmp[5]; | |
625 temp <<= 16; | |
626 temp &= 0x00ff0000; | |
627 totalsize |= temp; | |
628 temp = tmp[6]; | |
629 temp <<= 8; | |
630 temp &= 0x0000ff00; | |
631 totalsize |= temp; | |
632 temp = tmp[7]; | |
633 temp &= 0x000000ff; | |
634 totalsize |= temp; | |
626 | 635 |
627 name = tmp + 8; | 636 name = tmp + 8; |
628 | 637 |
629 ft = g_new0(struct file_transfer, 1); | 638 ft = g_new0(struct file_transfer, 1); |
630 | 639 |
631 ft->cookie = g_strdup(cookie); | 640 ft->cookie = frombase64(cookie); |
632 ft->ip = g_strdup(pip); | 641 ft->ip = g_strdup(pip); |
633 ft->port = port; | 642 ft->port = port; |
634 if (i) | 643 if (i) |
635 ft->message = g_strdup(messages[0]); | 644 ft->message = g_strdup(messages[0]); |
636 else | 645 else |
643 | 652 |
644 for (i--; i >= 0; i--) | 653 for (i--; i >= 0; i--) |
645 g_free(messages[i]); | 654 g_free(messages[i]); |
646 | 655 |
647 accept_file_dialog(ft); | 656 accept_file_dialog(ft); |
648 #endif | |
649 } else { | 657 } else { |
650 sprintf(debug_buff,"don't know what to do with %s\n", c); | 658 sprintf(debug_buff,"don't know what to do with %s\n", c); |
651 debug_print(debug_buff); | 659 debug_print(debug_buff); |
652 } | 660 } |
653 g_free(buf); | 661 g_free(buf); |