Mercurial > pidgin
comparison libpurple/protocols/yahoo/yahoo_profile.c @ 32672:3828a61c44da
A boring and large patch so I can merge heads.
author | Elliott Sales de Andrade <qulogic@pidgin.im> |
---|---|
date | Fri, 23 Dec 2011 08:21:58 +0000 |
parents | 99ca503ea087 |
children |
comparison
equal
deleted
inserted
replaced
32671:0e69949b3e61 | 32672:3828a61c44da |
---|---|
787 const char *title; | 787 const char *title; |
788 profile_state_t profile_state = PROFILE_STATE_DEFAULT; | 788 profile_state_t profile_state = PROFILE_STATE_DEFAULT; |
789 | 789 |
790 purple_debug_info("yahoo", "In yahoo_got_info\n"); | 790 purple_debug_info("yahoo", "In yahoo_got_info\n"); |
791 | 791 |
792 yd = info_data->gc->proto_data; | 792 yd = purple_connection_get_protocol_data(info_data->gc); |
793 yd->url_datas = g_slist_remove(yd->url_datas, url_data); | 793 yd->url_datas = g_slist_remove(yd->url_datas, url_data); |
794 | 794 |
795 user_info = purple_notify_user_info_new(); | 795 user_info = purple_notify_user_info_new(); |
796 | 796 |
797 title = yd->jp ? _("Yahoo! Japan Profile") : | 797 title = yd->jp ? _("Yahoo! Japan Profile") : |
938 /* User-uploaded photos use a different server that requires the Host | 938 /* User-uploaded photos use a different server that requires the Host |
939 * header, but Yahoo Japan will use the "chunked" content encoding if | 939 * header, but Yahoo Japan will use the "chunked" content encoding if |
940 * we specify HTTP 1.1. So we have to specify 1.0 & fix purple_util_fetch_url | 940 * we specify HTTP 1.1. So we have to specify 1.0 & fix purple_util_fetch_url |
941 */ | 941 */ |
942 url_data = purple_util_fetch_url(photo_url_text, use_whole_url, NULL, | 942 url_data = purple_util_fetch_url(photo_url_text, use_whole_url, NULL, |
943 FALSE, yahoo_got_photo, info2_data); | 943 FALSE, -1, yahoo_got_photo, info2_data); |
944 if (url_data != NULL) | 944 if (url_data != NULL) |
945 yd->url_datas = g_slist_prepend(yd->url_datas, url_data); | 945 yd->url_datas = g_slist_prepend(yd->url_datas, url_data); |
946 } else { | 946 } else { |
947 /* Emulate a callback */ | 947 /* Emulate a callback */ |
948 yahoo_got_photo(NULL, info2_data, NULL, 0, NULL); | 948 yahoo_got_photo(NULL, info2_data, NULL, 0, NULL); |
981 /* Jun 29 05 Bleeter: Y! changed their profile pages. Terminators now seem to be */ | 981 /* Jun 29 05 Bleeter: Y! changed their profile pages. Terminators now seem to be */ |
982 /* </dd> and not \n. The prpl's need to be audited before it can be moved */ | 982 /* </dd> and not \n. The prpl's need to be audited before it can be moved */ |
983 /* in to purple_markup_strip_html*/ | 983 /* in to purple_markup_strip_html*/ |
984 char *fudged_buffer; | 984 char *fudged_buffer; |
985 | 985 |
986 yd = info_data->gc->proto_data; | 986 yd = purple_connection_get_protocol_data(info_data->gc); |
987 yd->url_datas = g_slist_remove(yd->url_datas, url_data); | 987 yd->url_datas = g_slist_remove(yd->url_datas, url_data); |
988 | 988 |
989 fudged_buffer = purple_strcasereplace(url_buffer, "</dd>", "</dd><br>"); | 989 fudged_buffer = purple_strcasereplace(url_buffer, "</dd>", "</dd><br>"); |
990 /* nuke the html, it's easier than trying to parse the horrid stuff */ | 990 /* nuke the html, it's easier than trying to parse the horrid stuff */ |
991 stripped = purple_markup_strip_html(fudged_buffer); | 991 stripped = purple_markup_strip_html(fudged_buffer); |
1260 #endif /* PHOTO_SUPPORT */ | 1260 #endif /* PHOTO_SUPPORT */ |
1261 } | 1261 } |
1262 | 1262 |
1263 void yahoo_get_info(PurpleConnection *gc, const char *name) | 1263 void yahoo_get_info(PurpleConnection *gc, const char *name) |
1264 { | 1264 { |
1265 YahooData *yd = gc->proto_data; | 1265 YahooData *yd = purple_connection_get_protocol_data(gc); |
1266 YahooGetInfoData *data; | 1266 YahooGetInfoData *data; |
1267 char *url; | 1267 char *url; |
1268 PurpleUtilFetchUrlData *url_data; | 1268 PurpleUtilFetchUrlData *url_data; |
1269 | 1269 |
1270 data = g_new0(YahooGetInfoData, 1); | 1270 data = g_new0(YahooGetInfoData, 1); |
1272 data->name = g_strdup(name); | 1272 data->name = g_strdup(name); |
1273 | 1273 |
1274 url = g_strdup_printf("%s%s", | 1274 url = g_strdup_printf("%s%s", |
1275 (yd->jp ? YAHOOJP_PROFILE_URL : YAHOO_PROFILE_URL), name); | 1275 (yd->jp ? YAHOOJP_PROFILE_URL : YAHOO_PROFILE_URL), name); |
1276 | 1276 |
1277 url_data = purple_util_fetch_url(url, TRUE, NULL, FALSE, yahoo_got_info, data); | 1277 url_data = purple_util_fetch_url(url, TRUE, NULL, FALSE, -1, yahoo_got_info, data); |
1278 if (url_data != NULL) | 1278 if (url_data != NULL) |
1279 yd->url_datas = g_slist_prepend(yd->url_datas, url_data); | 1279 yd->url_datas = g_slist_prepend(yd->url_datas, url_data); |
1280 else { | 1280 else { |
1281 g_free(data->name); | 1281 g_free(data->name); |
1282 g_free(data); | 1282 g_free(data); |