Mercurial > pidgin
comparison src/protocols/yahoo/yahoo_profile.c @ 11644:f4e58e94ced3
[gaim-migrate @ 13922]
Yahoo! whitespace cleanup from Peter Lawler
Gracias!
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Wed, 12 Oct 2005 04:02:46 +0000 |
parents | 52695596064d |
children | 52f27ffe68a5 |
comparison
equal
deleted
inserted
replaced
11643:eb14bbcf7249 | 11644:f4e58e94ced3 |
---|---|
32 #endif | 32 #endif |
33 | 33 |
34 #include "yahoo.h" | 34 #include "yahoo.h" |
35 #include "yahoo_friend.h" | 35 #include "yahoo_friend.h" |
36 | 36 |
37 | |
38 typedef struct { | 37 typedef struct { |
39 GaimConnection *gc; | 38 GaimConnection *gc; |
40 char *name; | 39 char *name; |
41 } YahooGetInfoData; | 40 } YahooGetInfoData; |
42 | |
43 | 41 |
44 typedef enum profile_lang_id { | 42 typedef enum profile_lang_id { |
45 XX, DA, DE, EL, | 43 XX, DA, DE, EL, |
46 EN, EN_GB, | 44 EN, EN_GB, |
47 ES_AR, ES_ES, ES_MX, ES_US, | 45 ES_AR, ES_ES, ES_MX, ES_US, |
81 char *cool_link_2_string; | 79 char *cool_link_2_string; |
82 char *cool_link_3_string; | 80 char *cool_link_3_string; |
83 char *dummy; | 81 char *dummy; |
84 } profile_strings_node_t; | 82 } profile_strings_node_t; |
85 | 83 |
86 | |
87 typedef enum profile_state { | 84 typedef enum profile_state { |
88 PROFILE_STATE_DEFAULT, | 85 PROFILE_STATE_DEFAULT, |
89 PROFILE_STATE_NOT_FOUND, | 86 PROFILE_STATE_NOT_FOUND, |
90 PROFILE_STATE_UNKNOWN_LANGUAGE | 87 PROFILE_STATE_UNKNOWN_LANGUAGE |
91 } profile_state_t; | 88 } profile_state_t; |
92 | |
93 | 89 |
94 typedef struct { | 90 typedef struct { |
95 YahooGetInfoData *info_data; | 91 YahooGetInfoData *info_data; |
96 char *url_buffer; | 92 char *url_buffer; |
97 GString *s; | 93 GString *s; |
101 const profile_strings_node_t *strings; | 97 const profile_strings_node_t *strings; |
102 const char *last_updated_string; | 98 const char *last_updated_string; |
103 const char *title; | 99 const char *title; |
104 profile_state_t profile_state; | 100 profile_state_t profile_state; |
105 } YahooGetInfoStepTwoData; | 101 } YahooGetInfoStepTwoData; |
106 | |
107 | 102 |
108 /* Strings to determine the profile "language" (more accurately "locale"). | 103 /* Strings to determine the profile "language" (more accurately "locale"). |
109 * Strings in this list must be in the original charset in the profile. | 104 * Strings in this list must be in the original charset in the profile. |
110 * The "Last Updated" string is used, but sometimes is not sufficient to | 105 * The "Last Updated" string is used, but sometimes is not sufficient to |
111 * distinguish 2 locales with this (e.g., ES_ES from ES_US, or FR_CA from | 106 * distinguish 2 locales with this (e.g., ES_ES from ES_US, or FR_CA from |
966 /* gonna re-use the memory we've already got for url_buffer */ | 961 /* gonna re-use the memory we've already got for url_buffer */ |
967 /* no we're not */ | 962 /* no we're not */ |
968 s = g_string_sized_new(strlen(url_buffer)); | 963 s = g_string_sized_new(strlen(url_buffer)); |
969 | 964 |
970 if (profile_state == PROFILE_STATE_DEFAULT) { | 965 if (profile_state == PROFILE_STATE_DEFAULT) { |
971 | |
972 #if 0 | 966 #if 0 |
973 /* extract their Yahoo! ID and put it in. Don't bother marking has_info as | 967 /* extract their Yahoo! ID and put it in. Don't bother marking has_info as |
974 * true, since the Yahoo! ID will always be there */ | 968 * true, since the Yahoo! ID will always be there */ |
975 if (!gaim_markup_extract_info_field(stripped, stripped_len, s, | 969 if (!gaim_markup_extract_info_field(stripped, stripped_len, s, |
976 strings->yahoo_id_string, 10, "\n", 0, | 970 strings->yahoo_id_string, 10, "\n", 0, |
977 NULL, _("Yahoo! ID"), 0, NULL)) | 971 NULL, _("Yahoo! ID"), 0, NULL)) |
978 ; | 972 ; |
979 #endif | 973 #endif |
980 | 974 |
981 #if PHOTO_SUPPORT | 975 #if PHOTO_SUPPORT |
982 | |
983 /* Try to put the photo in there too, if there's one and is readable */ | 976 /* Try to put the photo in there too, if there's one and is readable */ |
984 if (data && url_text && len != 0) { | 977 if (data && url_text && len != 0) { |
985 if (strstr(url_text, "400 Bad Request") | 978 if (strstr(url_text, "400 Bad Request") |
986 || strstr(url_text, "403 Forbidden") | 979 || strstr(url_text, "403 Forbidden") |
987 || strstr(url_text, "404 Not Found")) { | 980 || strstr(url_text, "404 Not Found")) { |
992 gaim_debug_info("yahoo", "%s is %d bytes\n", photo_url_text, len); | 985 gaim_debug_info("yahoo", "%s is %d bytes\n", photo_url_text, len); |
993 id = gaim_imgstore_add(url_text, len, NULL); | 986 id = gaim_imgstore_add(url_text, len, NULL); |
994 g_string_append_printf(s, "<img id=\"%d\"><br>", id); | 987 g_string_append_printf(s, "<img id=\"%d\"><br>", id); |
995 } | 988 } |
996 } | 989 } |
997 | |
998 #endif /* PHOTO_SUPPORT */ | 990 #endif /* PHOTO_SUPPORT */ |
999 | 991 |
1000 /* extract their Email address and put it in */ | 992 /* extract their Email address and put it in */ |
1001 found |= gaim_markup_extract_info_field(stripped, stripped_len, s, | 993 found |= gaim_markup_extract_info_field(stripped, stripped_len, s, |
1002 strings->my_email_string, 1, " ", 0, | 994 strings->my_email_string, 1, " ", 0, |