pidgin: 42bd9f77: Add support for the uri-handler signal t...

nosnilmot at pidgin.im nosnilmot at pidgin.im
Tue Jan 5 20:10:33 EST 2010


-----------------------------------------------------------------
Revision: 42bd9f777ebde69580166733bdb898c243144b0c
Ancestor: 5b5373f2e1e46ecad79585d246b4875e254e8baa
Author: nosnilmot at pidgin.im
Date: 2010-01-06T01:03:02
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/42bd9f777ebde69580166733bdb898c243144b0c

Modified files:
        libpurple/plugins/signals-test.c

ChangeLog: 

Add support for the uri-handler signal to the signals-test plugin

-------------- next part --------------
============================================================
--- libpurple/plugins/signals-test.c	2495a23b78976e1ca7b01eda1853fcdd69e7d5b0
+++ libpurple/plugins/signals-test.c	b083e7380bbb0119bc84b9b50ec861d9d9541f50
@@ -547,6 +547,26 @@ quitting_cb(void *data)
 	purple_debug_misc("signals test", "quitting ()\n");
 }
 
+static void
+printhash(gpointer key, gpointer value, gpointer data)
+{
+	char *a = (char *)key;
+	char *b = (char *)value;
+	GString *str = (GString *)data;
+	g_string_append_printf(str, "   [%s] = [%s]\n", a, b ? b : "(null)");
+}
+
+static gboolean
+uri_handler(const char *proto, const char *cmd, GHashTable *params)
+{
+	GString *str = g_string_new("\n{\n");
+	g_hash_table_foreach(params, printhash, str);
+	g_string_append_c(str, '}');
+	purple_debug_misc("signals test", "uri handler (%s, %s, %s)\n", proto, cmd, str->str);
+	g_string_free(str, TRUE);
+	return FALSE;
+}
+
 /**************************************************************************
  * File transfer signal callbacks
  **************************************************************************/
@@ -820,6 +840,8 @@ plugin_load(PurplePlugin *plugin)
 	/* Core signals */
 	purple_signal_connect(core_handle, "quitting",
 						plugin, PURPLE_CALLBACK(quitting_cb), NULL);
+	purple_signal_connect(core_handle, "uri-handler",
+						plugin,	PURPLE_CALLBACK(uri_handler), NULL);
 
 	/* File transfer signals */
 	purple_signal_connect(ft_handle, "file-recv-accept",


More information about the Commits mailing list