comparison src/gaimrc.c @ 5580:86456ec3ca25

[gaim-migrate @ 5984] More nifty stuff! Accounts now get converted, and other niceties. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Sat, 31 May 2003 02:27:03 +0000
parents 5e7de337a053
children b07aa997ddd8
comparison
equal deleted inserted replaced
5579:e0146fcc4718 5580:86456ec3ca25
155 #define OPT_ACCT_AUTO 0x00000001 155 #define OPT_ACCT_AUTO 0x00000001
156 /*#define OPT_ACCT_KEEPALV 0x00000002 this shouldn't be optional */ 156 /*#define OPT_ACCT_KEEPALV 0x00000002 this shouldn't be optional */
157 #define OPT_ACCT_REM_PASS 0x00000004 157 #define OPT_ACCT_REM_PASS 0x00000004
158 #define OPT_ACCT_MAIL_CHECK 0x00000008 158 #define OPT_ACCT_MAIL_CHECK 0x00000008
159 159
160 GSList *gaim_accounts = NULL;
161 static guint misc_options; 160 static guint misc_options;
162 static guint logging_options; 161 static guint logging_options;
163 static guint blist_options; 162 static guint blist_options;
164 static guint convo_options; 163 static guint convo_options;
165 static guint im_options; 164 static guint im_options;
587 586
588 g_snprintf(account->proto_opt[i], sizeof account->proto_opt[i], "%s", p->value[i]); 587 g_snprintf(account->proto_opt[i], sizeof account->proto_opt[i], "%s", p->value[i]);
589 } 588 }
590 #endif 589 #endif
591 590
591 /* I hate this part. We must convert the protocol options. */
592 switch (gaim_account_get_protocol(account)) {
593 case GAIM_PROTO_TOC:
594 case GAIM_PROTO_OSCAR:
595 case GAIM_PROTO_JABBER:
596 gaim_account_set_string(account, "server", p->value[0]);
597 gaim_account_set_int(account, "port", atoi(p->value[1]));
598 break;
599
600 case GAIM_PROTO_MSN:
601 case GAIM_PROTO_NAPSTER:
602 case GAIM_PROTO_YAHOO:
603 gaim_account_set_string(account, "server", p->value[3]);
604 gaim_account_set_int(account, "port", atoi(p->value[4]));
605 break;
606
607 case GAIM_PROTO_IRC:
608 gaim_account_set_string(account, "server", p->value[0]);
609 gaim_account_set_int(account, "port", atoi(p->value[1]));
610 gaim_account_set_string(account, "charset", p->value[2]);
611 break;
612
613 case GAIM_PROTO_GADUGADU:
614 gaim_account_set_string(account, "nick", p->value[0]);
615 break;
616
617 default:
618 break;
619 }
620
592 if (!fgets(buf, sizeof(buf), f)) 621 if (!fgets(buf, sizeof(buf), f))
593 return account; 622 return account;
594 623
595 if (!strcmp(buf, "\t}")) 624 if (!strcmp(buf, "\t}"))
596 return account; 625 return account;
661 690
662 p = parse_line(buf, &parse_buffer); 691 p = parse_line(buf, &parse_buffer);
663 692
664 if (strcmp(p->option, "user")==0 || 693 if (strcmp(p->option, "user")==0 ||
665 strcmp(p->option, "current_user")==0) { 694 strcmp(p->option, "current_user")==0) {
666 if((account=gaimrc_read_user(f))!=NULL) 695 if((account=gaimrc_read_user(f))==NULL) {
667 gaim_accounts = g_slist_append(gaim_accounts, account);
668 else {
669 gaim_debug(GAIM_DEBUG_ERROR, "gaimrc", 696 gaim_debug(GAIM_DEBUG_ERROR, "gaimrc",
670 "Error reading in users from .gaimrc\n"); 697 "Error reading in users from .gaimrc\n");
671 return; 698 return;
672 } 699 }
673 } 700 }