grim/guifications2

update to the new purple http api

2013-01-16, Gary Kramlich
1b5432ae2861
Parents e29a2a0afc69
Children bd5172c22a03
update to the new purple http api
--- a/src/gf_preferences.c Wed Jan 16 22:18:55 2013 -0600
+++ b/src/gf_preferences.c Wed Jan 16 23:31:33 2013 -0600
@@ -31,6 +31,7 @@
#include "gf_internal.h"
#include <debug.h>
+#include <http.h>
#include <notify.h>
#include <plugin.h>
#include <prefs.h>
@@ -613,14 +614,21 @@
}
static void
-theme_got_url(PurpleUtilFetchUrlData *url_data, void *data,
- const char *themedata, size_t len, const gchar *err_msg)
+theme_got_url(PurpleHttpConnection *conn, PurpleHttpResponse *resp,
+ gpointer data)
{
FILE *f;
gchar *path;
+ const gchar *themedata;
+ size_t len;
+
+ if(!purple_http_response_is_successfull(resp))
+ return;
+
+ themedata = purple_http_response_get_data(resp, &len);
f = purple_mkstemp(&path, FALSE);
-
+
fwrite(themedata, len, 1, f);
fclose(f);
@@ -664,7 +672,7 @@
* other platforms, if need be */
/* Q: shouldn't tgz be tail? */
/* A: no. */
- purple_util_fetch_url(name, TRUE, NULL, FALSE, -1, theme_got_url, ".tgz");
+ purple_http_get(NULL, name, theme_got_url, ".tgz");
}
gtk_drag_finish(dc, TRUE, FALSE, t);