Mercurial > pidgin.yaz
comparison src/account.c @ 8834:beb7be215db3
[gaim-migrate @ 9598]
I removed account->ip because it isn't used anywhere and I think it's dumb.
Also added handling for a and aaaa records to rendezvous. Gaim peeps
show up in iChat rendezvous lists now. There are still problems.
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Wed, 28 Apr 2004 00:48:21 +0000 |
parents | 725413cc9fb9 |
children | db1dc2d02020 |
comparison
equal
deleted
inserted
replaced
8833:61fdef863ffa | 8834:beb7be215db3 |
---|---|
41 TAG_NAME, | 41 TAG_NAME, |
42 TAG_PASSWORD, | 42 TAG_PASSWORD, |
43 TAG_ALIAS, | 43 TAG_ALIAS, |
44 TAG_USERINFO, | 44 TAG_USERINFO, |
45 TAG_BUDDYICON, | 45 TAG_BUDDYICON, |
46 TAG_PUBLIC_IP, | |
47 TAG_SETTING, | 46 TAG_SETTING, |
48 TAG_TYPE, | 47 TAG_TYPE, |
49 TAG_HOST, | 48 TAG_HOST, |
50 TAG_PORT | 49 TAG_PORT |
51 | 50 |
507 | 506 |
508 gaim_account_set_ui_bool(account, ui, "auto-login", value); | 507 gaim_account_set_ui_bool(account, ui, "auto-login", value); |
509 } | 508 } |
510 | 509 |
511 void | 510 void |
512 gaim_account_set_public_ip(GaimAccount *account, const char *ip) | |
513 { | |
514 g_return_if_fail(account != NULL); | |
515 | |
516 if (account->ip != NULL) | |
517 g_free(account->ip); | |
518 | |
519 account->ip = (ip == NULL ? NULL : g_strdup(ip)); | |
520 | |
521 schedule_accounts_save(); | |
522 } | |
523 | |
524 void | |
525 gaim_account_set_proxy_info(GaimAccount *account, GaimProxyInfo *info) | 511 gaim_account_set_proxy_info(GaimAccount *account, GaimProxyInfo *info) |
526 { | 512 { |
527 g_return_if_fail(account != NULL); | 513 g_return_if_fail(account != NULL); |
528 | 514 |
529 if (account->proxy_info != NULL) | 515 if (account->proxy_info != NULL) |
782 { | 768 { |
783 g_return_val_if_fail(account != NULL, FALSE); | 769 g_return_val_if_fail(account != NULL, FALSE); |
784 g_return_val_if_fail(ui != NULL, FALSE); | 770 g_return_val_if_fail(ui != NULL, FALSE); |
785 | 771 |
786 return gaim_account_get_ui_bool(account, ui, "auto-login", FALSE); | 772 return gaim_account_get_ui_bool(account, ui, "auto-login", FALSE); |
787 } | |
788 | |
789 const char * | |
790 gaim_account_get_public_ip(const GaimAccount *account) | |
791 { | |
792 g_return_val_if_fail(account != NULL, NULL); | |
793 | |
794 return account->ip; | |
795 } | 773 } |
796 | 774 |
797 GaimProxyInfo * | 775 GaimProxyInfo * |
798 gaim_account_get_proxy_info(const GaimAccount *account) | 776 gaim_account_get_proxy_info(const GaimAccount *account) |
799 { | 777 { |
1003 data->tag = TAG_ALIAS; | 981 data->tag = TAG_ALIAS; |
1004 else if (!strcmp(element_name, "userinfo")) | 982 else if (!strcmp(element_name, "userinfo")) |
1005 data->tag = TAG_USERINFO; | 983 data->tag = TAG_USERINFO; |
1006 else if (!strcmp(element_name, "buddyicon")) | 984 else if (!strcmp(element_name, "buddyicon")) |
1007 data->tag = TAG_BUDDYICON; | 985 data->tag = TAG_BUDDYICON; |
1008 else if (!strcmp(element_name, "public-ip")) | |
1009 data->tag = TAG_PUBLIC_IP; | |
1010 else if (!strcmp(element_name, "proxy")) { | 986 else if (!strcmp(element_name, "proxy")) { |
1011 data->in_proxy = TRUE; | 987 data->in_proxy = TRUE; |
1012 | 988 |
1013 data->proxy_info = gaim_proxy_info_new(); | 989 data->proxy_info = gaim_proxy_info_new(); |
1014 } | 990 } |
1092 gaim_account_set_user_info(data->account, buffer); | 1068 gaim_account_set_user_info(data->account, buffer); |
1093 } | 1069 } |
1094 else if (data->tag == TAG_BUDDYICON) { | 1070 else if (data->tag == TAG_BUDDYICON) { |
1095 if (*buffer != '\0') | 1071 if (*buffer != '\0') |
1096 gaim_account_set_buddy_icon(data->account, buffer); | 1072 gaim_account_set_buddy_icon(data->account, buffer); |
1097 } | |
1098 else if (data->tag == TAG_PUBLIC_IP) { | |
1099 if (*buffer != '\0') | |
1100 gaim_account_set_public_ip(data->account, buffer); | |
1101 } | 1073 } |
1102 else if (data->tag == TAG_TYPE) { | 1074 else if (data->tag == TAG_TYPE) { |
1103 if (data->in_proxy) { | 1075 if (data->in_proxy) { |
1104 if (!strcmp(buffer, "global")) | 1076 if (!strcmp(buffer, "global")) |
1105 gaim_proxy_info_set_type(data->proxy_info, | 1077 gaim_proxy_info_set_type(data->proxy_info, |
1305 static void | 1277 static void |
1306 gaim_accounts_write(FILE *fp, GaimAccount *account) | 1278 gaim_accounts_write(FILE *fp, GaimAccount *account) |
1307 { | 1279 { |
1308 GaimProxyInfo *proxy_info; | 1280 GaimProxyInfo *proxy_info; |
1309 GaimProxyType proxy_type; | 1281 GaimProxyType proxy_type; |
1310 const char *password, *alias, *user_info, *buddy_icon, *ip; | 1282 const char *password, *alias, *user_info, *buddy_icon; |
1311 char *esc; | 1283 char *esc; |
1312 | 1284 |
1313 fprintf(fp, " <account>\n"); | 1285 fprintf(fp, " <account>\n"); |
1314 fprintf(fp, " <protocol>%s</protocol>\n", account->protocol_id); | 1286 fprintf(fp, " <protocol>%s</protocol>\n", account->protocol_id); |
1315 esc = g_markup_escape_text(gaim_account_get_username(account), -1); | 1287 esc = g_markup_escape_text(gaim_account_get_username(account), -1); |
1338 | 1310 |
1339 if ((buddy_icon = gaim_account_get_buddy_icon(account)) != NULL) { | 1311 if ((buddy_icon = gaim_account_get_buddy_icon(account)) != NULL) { |
1340 esc = g_markup_escape_text(buddy_icon, -1); | 1312 esc = g_markup_escape_text(buddy_icon, -1); |
1341 fprintf(fp, " <buddyicon>%s</buddyicon>\n", esc); | 1313 fprintf(fp, " <buddyicon>%s</buddyicon>\n", esc); |
1342 g_free(esc); | 1314 g_free(esc); |
1343 } | |
1344 | |
1345 if ((ip = gaim_account_get_public_ip(account)) != NULL) { | |
1346 fprintf(fp, " <public-ip>%s</public-ip>\n", ip); | |
1347 } | 1315 } |
1348 | 1316 |
1349 fprintf(fp, " <settings>\n"); | 1317 fprintf(fp, " <settings>\n"); |
1350 g_hash_table_foreach(account->settings, write_setting, fp); | 1318 g_hash_table_foreach(account->settings, write_setting, fp); |
1351 fprintf(fp, " </settings>\n"); | 1319 fprintf(fp, " </settings>\n"); |