grim/guifications2

Revert back to the purple2 url fetch api
draft
2021-04-07, Gary Kramlich
e1120d8aed5f
Parents 680bed833e7e
Children 834f10e81c38
Revert back to the purple2 url fetch api
--- a/src/gf_preferences.c Wed Apr 07 02:17:21 2021 -0500
+++ b/src/gf_preferences.c Wed Apr 07 02:20:10 2021 -0500
@@ -24,14 +24,9 @@
#include <unistd.h>
#include <string.h>
-#ifdef HAVE_CONFIG_H
-# include "../gf_config.h"
-#endif
-
#include "gf_internal.h"
#include <debug.h>
-#include <http.h>
#include <notify.h>
#include <plugin.h>
#include <prefs.h>
@@ -614,21 +609,14 @@
}
static void
-theme_got_url(PurpleHttpConnection *conn, PurpleHttpResponse *resp,
- gpointer data)
+theme_got_url(PurpleUtilFetchUrlData *url_data, void *data,
+ const char *themedata, size_t len, const gchar *err_msg)
{
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);
@@ -672,7 +660,7 @@
* other platforms, if need be */
/* Q: shouldn't tgz be tail? */
/* A: no. */
- purple_http_get(NULL, name, theme_got_url, ".tgz");
+ purple_util_fetch_url(name, TRUE, NULL, FALSE, theme_got_url, ".tgz");
}
gtk_drag_finish(dc, TRUE, FALSE, t);