Mercurial > pidgin
comparison src/gaimrc.c @ 5618:83991299705c
[gaim-migrate @ 6025]
i really need to go grocery shopping
committer: Tailor Script <tailor@pidgin.im>
author | Nathan Walp <nwalp@pidgin.im> |
---|---|
date | Sat, 31 May 2003 20:55:31 +0000 |
parents | 9cd94a5bec8e |
children | 960fe32ea9b7 |
comparison
equal
deleted
inserted
replaced
5617:feb012e01741 | 5618:83991299705c |
---|---|
501 GaimAccount *account; | 501 GaimAccount *account; |
502 int i; | 502 int i; |
503 char buf[4096]; | 503 char buf[4096]; |
504 char user_info[2048]; | 504 char user_info[2048]; |
505 int flags; | 505 int flags; |
506 char *tmp; | |
506 | 507 |
507 if (!fgets(buf, sizeof(buf), f)) | 508 if (!fgets(buf, sizeof(buf), f)) |
508 return NULL; | 509 return NULL; |
509 | 510 |
510 p = parse_line(buf, &parse_buffer); | 511 p = parse_line(buf, &parse_buffer); |
576 | 577 |
577 p = parse_line(buf, &parse_buffer); | 578 p = parse_line(buf, &parse_buffer); |
578 | 579 |
579 if (strcmp(p->option, "proto_opts")) | 580 if (strcmp(p->option, "proto_opts")) |
580 return account; | 581 return account; |
581 | |
582 /* TODO: Server and port should be preserved! :/ */ | |
583 #if 0 | |
584 for (i = 0; i < 7; i++) { | |
585 char buf[256]; | |
586 | |
587 g_snprintf(account->proto_opt[i], sizeof account->proto_opt[i], "%s", p->value[i]); | |
588 } | |
589 #endif | |
590 | 582 |
591 /* I hate this part. We must convert the protocol options. */ | 583 /* I hate this part. We must convert the protocol options. */ |
592 switch (gaim_account_get_protocol(account)) { | 584 switch (gaim_account_get_protocol(account)) { |
593 case GAIM_PROTO_TOC: | 585 case GAIM_PROTO_TOC: |
594 case GAIM_PROTO_OSCAR: | 586 case GAIM_PROTO_OSCAR: |
607 gaim_account_set_string(account, "server", p->value[3]); | 599 gaim_account_set_string(account, "server", p->value[3]); |
608 gaim_account_set_int(account, "port", atoi(p->value[4])); | 600 gaim_account_set_int(account, "port", atoi(p->value[4])); |
609 break; | 601 break; |
610 | 602 |
611 case GAIM_PROTO_IRC: | 603 case GAIM_PROTO_IRC: |
612 /* XXX: fix this */ | 604 if(strlen(p->value[0]) && !strchr(account->username, '@')) { |
613 gaim_account_set_string(account, "server", p->value[0]); | 605 tmp = g_strdup_printf("%s@%s", account->username, p->value[0]); |
606 gaim_account_set_username(account, tmp); | |
607 g_free(tmp); | |
608 } | |
614 gaim_account_set_int(account, "port", atoi(p->value[1])); | 609 gaim_account_set_int(account, "port", atoi(p->value[1])); |
615 gaim_account_set_string(account, "charset", p->value[2]); | 610 gaim_account_set_string(account, "charset", p->value[2]); |
616 break; | |
617 | |
618 case GAIM_PROTO_GADUGADU: | |
619 gaim_account_set_string(account, "nick", p->value[0]); | |
620 break; | 611 break; |
621 | 612 |
622 default: | 613 default: |
623 break; | 614 break; |
624 } | 615 } |