comparison libpurple/protocols/yahoo/yahoo_profile.c @ 27780:1a121394bfde

fixed indentation
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Sun, 02 Mar 2008 21:35:56 +0000
parents 0f3a131d23da
children 85d5b6c06a6c
comparison
equal deleted inserted replaced
27779:75ec5def57b3 27780:1a121394bfde
1020 if (p) { 1020 if (p) {
1021 g_free(stripped); 1021 g_free(stripped);
1022 stripped = purple_utf8_ncr_decode(p); 1022 stripped = purple_utf8_ncr_decode(p);
1023 stripped_len = strlen(stripped); 1023 stripped_len = strlen(stripped);
1024 1024
1025 purple_debug_misc("yahoo", "after utf8 conversion: stripped@1 = (%s)\n", 1025 purple_debug_misc("yahoo", "after utf8 conversion: stripped@1 = (%s)\n",
1026 stripped); //payload --yaz 1026 stripped); //payload --yaz
1027 g_free(p); 1027 g_free(p);
1028 } 1028 }
1029 } 1029 }
1030 p = NULL; 1030 p = NULL;
1070 purple_debug_info("yahoo", "email = %s\n", strings->my_email_string); 1070 purple_debug_info("yahoo", "email = %s\n", strings->my_email_string);
1071 1071
1072 /* extract their Email address and put it in */ 1072 /* extract their Email address and put it in */
1073 found |= purple_markup_extract_info_field(stripped, stripped_len, user_info, 1073 found |= purple_markup_extract_info_field(stripped, stripped_len, user_info,
1074 strings->my_email_string, (yd->jp ? 4 : 1), " ", 0, 1074 strings->my_email_string, (yd->jp ? 4 : 1), " ", 0,
1075 strings->private_string, _("E-Mail"), 0, NULL, NULL); 1075 strings->private_string, _("E-Mail"), 0, NULL, NULL);
1076 #if 0 1076 #if 0
1077 /* extract the Nickname if it exists */ 1077 /* extract the Nickname if it exists */
1078 found |= purple_markup_extract_info_field(stripped, stripped_len, user_info, 1078 found |= purple_markup_extract_info_field(stripped, stripped_len, user_info,
1079 "Nickname:", 1, "\n", '\n', 1079 "Nickname:", 1, "\n", '\n',
1080 NULL, _("Nickname"), 0, NULL, NULL); 1080 NULL, _("Nickname"), 0, NULL, NULL);
1081 1081
1082 /* extract their RealName and put it in */ 1082 /* extract their RealName and put it in */
1083 found |= purple_markup_extract_info_field(stripped, stripped_len, user_info, 1083 found |= purple_markup_extract_info_field(stripped, stripped_len, user_info,
1084 strings->realname_string, (yd->jp ? 3 : 1), "\n", '\n', 1084 strings->realname_string, (yd->jp ? 3 : 1), "\n", '\n',
1085 NULL, _("Real Name"), 0, NULL, NULL); 1085 NULL, _("Real Name"), 0, NULL, NULL);
1086 1086
1087 /* extract their Location and put it in */ 1087 /* extract their Location and put it in */
1088 found |= purple_markup_extract_info_field(stripped, stripped_len, user_info, 1088 found |= purple_markup_extract_info_field(stripped, stripped_len, user_info,
1089 strings->location_string, (yd->jp ? 4 : 2), "\n", '\n', 1089 strings->location_string, (yd->jp ? 4 : 2), "\n", '\n',
1090 NULL, _("Location"), 0, NULL, NULL); 1090 NULL, _("Location"), 0, NULL, NULL);
1091 1091
1092 /* extract their Age and put it in */ 1092 /* extract their Age and put it in */
1093 found |= purple_markup_extract_info_field(stripped, stripped_len, user_info, 1093 found |= purple_markup_extract_info_field(stripped, stripped_len, user_info,
1094 strings->age_string, (yd->jp ? 2 : 3), "\n", '\n', 1094 strings->age_string, (yd->jp ? 2 : 3), "\n", '\n',
1095 NULL, _("Age"), 0, NULL, NULL); 1095 NULL, _("Age"), 0, NULL, NULL);
1096 1096
1097 /* extract their MaritalStatus and put it in */ 1097 /* extract their MaritalStatus and put it in */
1098 found |= purple_markup_extract_info_field(stripped, stripped_len, user_info, 1098 found |= purple_markup_extract_info_field(stripped, stripped_len, user_info,
1099 strings->maritalstatus_string, (yd->jp ? 2 : 3), "\n", '\n', 1099 strings->maritalstatus_string, (yd->jp ? 2 : 3), "\n", '\n',
1100 strings->no_answer_string, _("Marital Status"), 0, NULL, NULL); 1100 strings->no_answer_string, _("Marital Status"), 0, NULL, NULL);
1101 1101
1102 /* extract their Gender and put it in */ 1102 /* extract their Gender and put it in */
1103 found |= purple_markup_extract_info_field(stripped, stripped_len, user_info, 1103 found |= purple_markup_extract_info_field(stripped, stripped_len, user_info,
1104 strings->gender_string, (yd->jp ? 2 : 3), "\n", '\n', 1104 strings->gender_string, (yd->jp ? 2 : 3), "\n", '\n',
1105 strings->no_answer_string, _("Gender"), 0, NULL, NULL); 1105 strings->no_answer_string, _("Gender"), 0, NULL, NULL);
1106 1106
1107 /* extract their Occupation and put it in */ 1107 /* extract their Occupation and put it in */
1108 found |= purple_markup_extract_info_field(stripped, stripped_len, user_info, 1108 found |= purple_markup_extract_info_field(stripped, stripped_len, user_info,
1109 strings->occupation_string, 2, "\n", '\n', 1109 strings->occupation_string, 2, "\n", '\n',
1110 NULL, _("Occupation"), 0, NULL, NULL); 1110 NULL, _("Occupation"), 0, NULL, NULL);
1111 #endif 1111 #endif
1112 /* Hobbies, Latest News, and Favorite Quote are a bit different, since 1112 /* Hobbies, Latest News, and Favorite Quote are a bit different, since
1113 * the values can contain embedded newlines... but any or all of them 1113 * the values can contain embedded newlines... but any or all of them
1114 * can also not appear. The way we delimit them is to successively 1114 * can also not appear. The way we delimit them is to successively
1115 * look for the next one that _could_ appear, and if all else fails, 1115 * look for the next one that _could_ appear, and if all else fails,
1118 * the "Description" ("Self PR") heading instead of "Links".) 1118 * the "Description" ("Self PR") heading instead of "Links".)
1119 */ 1119 */
1120 #if 0 1120 #if 0
1121 if (!purple_markup_extract_info_field(stripped, stripped_len, user_info, 1121 if (!purple_markup_extract_info_field(stripped, stripped_len, user_info,
1122 strings->hobbies_string, (yd->jp ? 3 : 1), strings->latest_news_string, 1122 strings->hobbies_string, (yd->jp ? 3 : 1), strings->latest_news_string,
1123 '\n', "\n", _("Hobbies"), 0, NULL, NULL)) 1123 '\n', "\n", _("Hobbies"), 0, NULL, NULL))
1124 { 1124 {
1125 if (!purple_markup_extract_info_field(stripped, stripped_len, user_info, 1125 if (!purple_markup_extract_info_field(stripped, stripped_len, user_info,
1126 strings->hobbies_string, 1, strings->favorite_quote_string, 1126 strings->hobbies_string, 1, strings->favorite_quote_string,
1127 '\n', "\n", _("Hobbies"), 0, NULL, NULL)) 1127 '\n', "\n", _("Hobbies"), 0, NULL, NULL))
1128 { 1128 {
1129 found |= purple_markup_extract_info_field(stripped, stripped_len, user_info, 1129 found |= purple_markup_extract_info_field(stripped, stripped_len, user_info,
1130 strings->hobbies_string, 1, strings->links_string, 1130 strings->hobbies_string, 1, strings->links_string,
1131 '\n', "\n", _("Hobbies"), 0, NULL, NULL); 1131 '\n', "\n", _("Hobbies"), 0, NULL, NULL);
1132 } 1132 }
1133 else 1133 else
1134 found = TRUE; 1134 found = TRUE;
1135 } 1135 }
1136 else 1136 else
1137 found = TRUE; 1137 found = TRUE;
1138 1138
1139 if (!purple_markup_extract_info_field(stripped, stripped_len, user_info, 1139 if (!purple_markup_extract_info_field(stripped, stripped_len, user_info,
1140 strings->latest_news_string, 1, strings->favorite_quote_string, 1140 strings->latest_news_string, 1, strings->favorite_quote_string,
1141 '\n', "\n", _("Latest News"), 0, NULL, NULL)) 1141 '\n', "\n", _("Latest News"), 0, NULL, NULL))
1142 { 1142 {
1143 found |= purple_markup_extract_info_field(stripped, stripped_len, user_info, 1143 found |= purple_markup_extract_info_field(stripped, stripped_len, user_info,
1144 strings->latest_news_string, (yd->jp ? 2 : 1), strings->links_string, 1144 strings->latest_news_string, (yd->jp ? 2 : 1), strings->links_string,
1145 '\n', "\n", _("Latest News"), 0, NULL, NULL); 1145 '\n', "\n", _("Latest News"), 0, NULL, NULL);
1146 } 1146 }
1147 else 1147 else
1148 found = TRUE; 1148 found = TRUE;
1149 1149
1150 found |= purple_markup_extract_info_field(stripped, stripped_len, user_info, 1150 found |= purple_markup_extract_info_field(stripped, stripped_len, user_info,
1151 strings->favorite_quote_string, 1, strings->links_string, 1151 strings->favorite_quote_string, 1, strings->links_string,
1152 '\n', "\n", _("Favorite Quote"), 0, NULL, NULL); 1152 '\n', "\n", _("Favorite Quote"), 0, NULL, NULL);
1153 1153
1154 /* Home Page will either be "No home page specified", 1154 /* Home Page will either be "No home page specified",
1155 * or "Home Page: " and a link. 1155 * or "Home Page: " and a link.
1156 * For Yahoo! Japan, if there is no home page specified, 1156 * For Yahoo! Japan, if there is no home page specified,
1157 * neither "No home page specified" nor "Home Page:" is shown. 1157 * neither "No home page specified" nor "Home Page:" is shown.
1161 strstr(stripped, strings->no_home_page_specified_string); 1161 strstr(stripped, strings->no_home_page_specified_string);
1162 if(!p) 1162 if(!p)
1163 { 1163 {
1164 found |= purple_markup_extract_info_field(stripped, stripped_len, user_info, 1164 found |= purple_markup_extract_info_field(stripped, stripped_len, user_info,
1165 strings->home_page_string, 1, "\n", 0, NULL, 1165 strings->home_page_string, 1, "\n", 0, NULL,
1166 _("Home Page"), 1, NULL, NULL); 1166 _("Home Page"), 1, NULL, NULL);
1167 } 1167 }
1168 } 1168 }
1169 1169
1170 /* Cool Link {1,2,3} is also different. If "No cool link specified" 1170 /* Cool Link {1,2,3} is also different. If "No cool link specified"
1171 * exists, then we have none. If we have one however, we'll need to 1171 * exists, then we have none. If we have one however, we'll need to
1176 strstr(stripped,strings->no_cool_link_specified_string); 1176 strstr(stripped,strings->no_cool_link_specified_string);
1177 if (!p) 1177 if (!p)
1178 { 1178 {
1179 if (purple_markup_extract_info_field(stripped, stripped_len, user_info, 1179 if (purple_markup_extract_info_field(stripped, stripped_len, user_info,
1180 strings->cool_link_1_string, 1, "\n", 0, NULL, 1180 strings->cool_link_1_string, 1, "\n", 0, NULL,
1181 _("Cool Link 1"), 1, NULL, NULL)) 1181 _("Cool Link 1"), 1, NULL, NULL))
1182 { 1182 {
1183 found = TRUE; 1183 found = TRUE;
1184 if (purple_markup_extract_info_field(stripped, stripped_len, user_info, 1184 if (purple_markup_extract_info_field(stripped, stripped_len, user_info,
1185 strings->cool_link_2_string, 1, "\n", 0, NULL, 1185 strings->cool_link_2_string, 1, "\n", 0, NULL,
1186 _("Cool Link 2"), 1, NULL, NULL)) 1186 _("Cool Link 2"), 1, NULL, NULL))
1194 1194
1195 if (last_updated_utf8_string != NULL) { 1195 if (last_updated_utf8_string != NULL) {
1196 /* see if Member Since is there, and if so, extract it. */ 1196 /* see if Member Since is there, and if so, extract it. */
1197 found |= purple_markup_extract_info_field(stripped, stripped_len, user_info, 1197 found |= purple_markup_extract_info_field(stripped, stripped_len, user_info,
1198 "Member Since:", 1, last_updated_utf8_string, 1198 "Member Since:", 1, last_updated_utf8_string,
1199 '\n', NULL, _("Member Since"), 0, NULL, yahoo_info_date_reformat); 1199 '\n', NULL, _("Member Since"), 0, NULL, yahoo_info_date_reformat);
1200 1200
1201 /* extract the Last Updated date and put it in */ 1201 /* extract the Last Updated date and put it in */
1202 found |= purple_markup_extract_info_field(stripped, stripped_len, user_info, 1202 found |= purple_markup_extract_info_field(stripped, stripped_len, user_info,
1203 last_updated_utf8_string, (yd->jp ? 2 : 1), (yd->jp ? "\n" : " "), (yd->jp ? 0 : '\n'), NULL, 1203 last_updated_utf8_string, (yd->jp ? 2 : 1), (yd->jp ? "\n" : " "), (yd->jp ? 0 : '\n'), NULL,
1204 _("Last Update"), 0, NULL, (yd->jp ? NULL : yahoo_info_date_reformat)); 1204 _("Last Update"), 0, NULL, (yd->jp ? NULL : yahoo_info_date_reformat));
1205 } 1205 }
1206 #endif 1206 #endif
1207 } /* if (profile_state == PROFILE_STATE_DEFAULT) */ 1207 } /* if (profile_state == PROFILE_STATE_DEFAULT) */
1208 1208
1209 if(!found) 1209 if(!found)