Mercurial > pidgin.yaz
changeset 15839:90188f78beeb
merge of '86166d6c6bbbb2db3ad947a061bfb6f4f13d9d1c'
and '9d39bda320a4f35bdab8e3a3ec39c79d34ddedc8'
author | Daniel Atallah <daniel.atallah@gmail.com> |
---|---|
date | Mon, 19 Mar 2007 17:37:34 +0000 |
parents | e622745f6f42 (current diff) ed80ec6be33c (diff) |
children | cf140d8c878c c4f348500fa7 |
files | libpurple/plugins/perl/common/Gaim.pm libpurple/plugins/perl/common/Gaim.xs libpurple/win32/wgaimerror.h |
diffstat | 3 files changed, 46 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/configure.ac Mon Mar 19 17:37:17 2007 +0000 +++ b/configure.ac Mon Mar 19 17:37:34 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)
--- a/libpurple/util.c Mon Mar 19 17:37:17 2007 +0000 +++ b/libpurple/util.c Mon Mar 19 17:37:34 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;
--- a/pidgin/gtkstatusbox.c Mon Mar 19 17:37:17 2007 +0000 +++ b/pidgin/gtkstatusbox.c Mon Mar 19 17:37:34 2007 +0000 @@ -42,6 +42,7 @@ #include <gdk/gdkkeysyms.h> #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