comparison src/account.c @ 5792:d89cadcafbec

[gaim-migrate @ 6217] Empty data between tags are now considered NULL. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Sat, 07 Jun 2003 06:09:02 +0000
parents a9029bed0479
children 5e93fc46d1af
comparison
equal deleted inserted replaced
5791:f5a4a17c58a5 5792:d89cadcafbec
829 829
830 data->protocol_id = NULL; 830 data->protocol_id = NULL;
831 } 831 }
832 } 832 }
833 else if (data->tag == TAG_PASSWORD) { 833 else if (data->tag == TAG_PASSWORD) {
834 if (data->in_proxy) { 834 if (strcmp(buffer, "")) {
835 gaim_proxy_info_set_password(data->proxy_info, buffer); 835 if (data->in_proxy) {
836 } 836 gaim_proxy_info_set_password(data->proxy_info, buffer);
837 else { 837 }
838 gaim_account_set_password(data->account, buffer); 838 else {
839 gaim_account_set_remember_password(data->account, TRUE); 839 gaim_account_set_password(data->account, buffer);
840 gaim_account_set_remember_password(data->account, TRUE);
841 }
840 } 842 }
841 } 843 }
842 else if (data->tag == TAG_ALIAS) 844 else if (data->tag == TAG_ALIAS)
843 gaim_account_set_alias(data->account, buffer); 845 gaim_account_set_alias(data->account, buffer);
844 else if (data->tag == TAG_USERINFO) 846 else if (data->tag == TAG_USERINFO)
862 "information for %s\n", 864 "information for %s\n",
863 gaim_account_get_username(data->account)); 865 gaim_account_get_username(data->account));
864 } 866 }
865 } 867 }
866 else if (data->tag == TAG_HOST) { 868 else if (data->tag == TAG_HOST) {
867 if (data->in_proxy) { 869 if (data->in_proxy && strcmp(buffer, ""))
868 gaim_proxy_info_set_host(data->proxy_info, buffer); 870 gaim_proxy_info_set_host(data->proxy_info, buffer);
869 }
870 } 871 }
871 else if (data->tag == TAG_PORT) { 872 else if (data->tag == TAG_PORT) {
872 if (data->in_proxy) { 873 if (data->in_proxy && strcmp(buffer, ""))
873 gaim_proxy_info_set_port(data->proxy_info, atoi(buffer)); 874 gaim_proxy_info_set_port(data->proxy_info, atoi(buffer));
874 }
875 } 875 }
876 else if (data->tag == TAG_SETTING) { 876 else if (data->tag == TAG_SETTING) {
877 if (data->setting_ui != NULL) { 877 if (strcmp(buffer, "")) {
878 if (data->setting_type == GAIM_PREF_STRING) 878 if (data->setting_ui != NULL) {
879 gaim_account_set_ui_string(data->account, data->setting_ui, 879 if (data->setting_type == GAIM_PREF_STRING)
880 data->setting_name, buffer); 880 gaim_account_set_ui_string(data->account, data->setting_ui,
881 else if (data->setting_type == GAIM_PREF_INT) 881 data->setting_name, buffer);
882 gaim_account_set_ui_int(data->account, data->setting_ui, 882 else if (data->setting_type == GAIM_PREF_INT)
883 data->setting_name, atoi(buffer)); 883 gaim_account_set_ui_int(data->account, data->setting_ui,
884 else if (data->setting_type == GAIM_PREF_BOOLEAN) 884 data->setting_name, atoi(buffer));
885 gaim_account_set_ui_bool(data->account, data->setting_ui, 885 else if (data->setting_type == GAIM_PREF_BOOLEAN)
886 data->setting_name, 886 gaim_account_set_ui_bool(data->account, data->setting_ui,
887 (*buffer == '0' ? FALSE : TRUE)); 887 data->setting_name,
888 } 888 (*buffer == '0' ? FALSE : TRUE));
889 else { 889 }
890 if (data->setting_type == GAIM_PREF_STRING) 890 else {
891 gaim_account_set_string(data->account, data->setting_name, 891 if (data->setting_type == GAIM_PREF_STRING)
892 buffer); 892 gaim_account_set_string(data->account, data->setting_name,
893 else if (data->setting_type == GAIM_PREF_INT) 893 buffer);
894 gaim_account_set_int(data->account, data->setting_name, 894 else if (data->setting_type == GAIM_PREF_INT)
895 atoi(buffer)); 895 gaim_account_set_int(data->account, data->setting_name,
896 else if (data->setting_type == GAIM_PREF_BOOLEAN) 896 atoi(buffer));
897 gaim_account_set_bool(data->account, data->setting_name, 897 else if (data->setting_type == GAIM_PREF_BOOLEAN)
898 (*buffer == '0' ? FALSE : TRUE)); 898 gaim_account_set_bool(data->account, data->setting_name,
899 (*buffer == '0' ? FALSE : TRUE));
900 }
899 } 901 }
900 902
901 g_free(data->setting_name); 903 g_free(data->setting_name);
902 data->setting_name = NULL; 904 data->setting_name = NULL;
903 } 905 }
906 908
907 if (gaim_proxy_info_get_type(data->proxy_info) == GAIM_PROXY_NONE) { 909 if (gaim_proxy_info_get_type(data->proxy_info) == GAIM_PROXY_NONE) {
908 gaim_proxy_info_destroy(data->proxy_info); 910 gaim_proxy_info_destroy(data->proxy_info);
909 data->proxy_info = NULL; 911 data->proxy_info = NULL;
910 } 912 }
911 else { 913 else if (strcmp(buffer, "")) {
912 gaim_account_set_proxy_info(data->account, data->proxy_info); 914 gaim_account_set_proxy_info(data->account, data->proxy_info);
913 } 915 }
914 } 916 }
915 else if (!strcmp(element_name, "settings")) { 917 else if (!strcmp(element_name, "settings")) {
916 if (data->setting_ui != NULL) { 918 if (data->setting_ui != NULL) {