# HG changeset patch # User Sean Egan # Date 1174298616 0 # Node ID ed80ec6be33c4ad782ffadf73047e9335672d586 # Parent 32c366eeeb9983a20225019560b4980729c5abad who knew that --disable-plugins still worked?! Also, some completely untested support for aim:buddyicon, which I'll look at more tomorrow diff -r 32c366eeeb99 -r ed80ec6be33c configure.ac --- a/configure.ac Mon Mar 19 07:01:17 2007 +0000 +++ b/configure.ac Mon Mar 19 10:03:36 2007 +0000 @@ -1717,7 +1717,7 @@ AC_SUBST(LIBS) if test "x$enable_plugins" = "xyes" ; then - AC_DEFINE(GAIM_PLUGINS, 1, [Define if plugins are enabled.]) + AC_DEFINE(PURPLE_PLUGINS, 1, [Define if plugins are enabled.]) AM_CONDITIONAL(PLUGINS, true) else AM_CONDITIONAL(PLUGINS, false) diff -r 32c366eeeb99 -r ed80ec6be33c libpurple/util.c --- a/libpurple/util.c Mon Mar 19 07:01:17 2007 +0000 +++ b/libpurple/util.c Mon Mar 19 10:03:36 2007 +0000 @@ -3004,7 +3004,7 @@ char *cmd; GHashTable *params = NULL; int len; - +printf("got handler uri \n"); if (!(tmp = strchr(uri, ':')) || tmp == uri) { purple_debug_error("util", "Malformed protocol handler message - missing protocol.\n"); return; diff -r 32c366eeeb99 -r ed80ec6be33c pidgin/gtkstatusbox.c --- a/pidgin/gtkstatusbox.c Mon Mar 19 07:01:17 2007 +0000 +++ b/pidgin/gtkstatusbox.c Mon Mar 19 10:03:36 2007 +0000 @@ -42,6 +42,7 @@ #include #include "account.h" +#include "core.h" #include "internal.h" #include "network.h" #include "savedstatuses.h" @@ -295,6 +296,46 @@ gtk_drag_finish(dc, FALSE, FALSE, t); } +static void +statusbox_got_url(PurpleUtilFetchUrlData *url_data, gpointer user_data, + const gchar *themedata, size_t len, const gchar *error_message, + PidginStatusBox *status_box) +{ + FILE *f; + gchar *path; + + if ((error_message != NULL) || (len == 0)) + return; + + f = purple_mkstemp(&path, TRUE); + fwrite(themedata, len, 1, f); + fclose(f); + + icon_choose_cb(path, status_box); + + g_unlink(path); + g_free(path); +} + + +static gboolean +statusbox_uri_handler(const char *proto, const char *cmd, GHashTable *params, void *data) +{ + const char *src; +printf("%s %s\n", proto, cmd); + if (g_ascii_strcasecmp(proto, "aim")) + return FALSE; + + if (g_ascii_strcasecmp(cmd, "buddyicon")) + return FALSE; + + src = g_hash_table_lookup(params, "account"); + if (src == NULL) + return FALSE; + + purple_util_fetch_url(src, TRUE, NULL, FALSE, statusbox_got_url, data); + return TRUE; +} static gboolean icon_box_enter_cb(GtkWidget *widget, GdkEventCrossing *event, PidginStatusBox *box) @@ -1735,6 +1776,9 @@ spellcheck_prefs_cb, status_box); purple_prefs_connect_callback(status_box, "/purple/gtk/accounts/buddyicon", update_buddyicon_cb, status_box); + purple_signal_connect(purple_get_core(), "uri-handler", status_box, + PURPLE_CALLBACK(statusbox_uri_handler), status_box); + } static void