comparison libpurple/protocols/yahoo/yahoo_picture.c @ 22056:b0ed2ce8514d

A patch from Gideon N. Guillen, with some minor modifications from me. This patch fixes retrieval of buddy icons and setting of server-side aliases when using an HTTP proxy.
author John Bailey <rekkanoryo@rekkanoryo.org>
date Sun, 24 Feb 2008 18:20:52 +0000
parents 44b4e8bd759b
children 3f9877080462
comparison
equal deleted inserted replaced
22016:aba0620b1a37 22056:b0ed2ce8514d
114 /* TODO: make this work p2p, try p2p before the url */ 114 /* TODO: make this work p2p, try p2p before the url */
115 PurpleUtilFetchUrlData *url_data; 115 PurpleUtilFetchUrlData *url_data;
116 struct yahoo_fetch_picture_data *data; 116 struct yahoo_fetch_picture_data *data;
117 PurpleBuddy *b = purple_find_buddy(gc->account, who); 117 PurpleBuddy *b = purple_find_buddy(gc->account, who);
118 const char *locksum = NULL; 118 const char *locksum = NULL;
119 gboolean use_whole_url = FALSE;
120
121 /* use whole URL if using HTTP Proxy */
122 if ((gc->account->proxy_info) && (gc->account->proxy_info->type == PURPLE_PROXY_HTTP))
123 use_whole_url = TRUE;
119 124
120 /* FIXME: Cleanup this strtol() stuff if possible. */ 125 /* FIXME: Cleanup this strtol() stuff if possible. */
121 if (b && (locksum = purple_buddy_icons_get_checksum_for_user(b)) != NULL && 126 if (b && (locksum = purple_buddy_icons_get_checksum_for_user(b)) != NULL &&
122 (checksum == strtol(locksum, NULL, 10))) 127 (checksum == strtol(locksum, NULL, 10)))
123 return; 128 return;
124 129
125 data = g_new0(struct yahoo_fetch_picture_data, 1); 130 data = g_new0(struct yahoo_fetch_picture_data, 1);
126 data->gc = gc; 131 data->gc = gc;
127 data->who = g_strdup(who); 132 data->who = g_strdup(who);
128 data->checksum = checksum; 133 data->checksum = checksum;
129 url_data = purple_util_fetch_url(url, FALSE, 134 url_data = purple_util_fetch_url(url, use_whole_url,
130 "Mozilla/4.0 (compatible; MSIE 5.0)", FALSE, 135 "Mozilla/4.0 (compatible; MSIE 5.0)", FALSE,
131 yahoo_fetch_picture_cb, data); 136 yahoo_fetch_picture_cb, data);
132 if (url_data != NULL) { 137 if (url_data != NULL) {
133 yd = gc->proto_data; 138 yd = gc->proto_data;
134 yd->url_datas = g_slist_prepend(yd->url_datas, url_data); 139 yd->url_datas = g_slist_prepend(yd->url_datas, url_data);