changeset 19044:602295db8e6b

- Register the certificate-stored and certificate-deleted signals
author William Ehlhardt <williamehlhardt@gmail.com>
date Fri, 27 Jul 2007 06:56:00 +0000
parents 8026af6fbb3b
children 2aa5a9f47470
files libpurple/certificate.c libpurple/value.h
diffstat 2 files changed, 25 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/certificate.c	Fri Jul 27 04:38:56 2007 +0000
+++ b/libpurple/certificate.c	Fri Jul 27 06:56:00 2007 +0000
@@ -32,6 +32,7 @@
 #include "debug.h"
 #include "internal.h"
 #include "request.h"
+#include "signals.h"
 #include "util.h"
 
 /** List holding pointers to all registered certificate schemes */
@@ -1013,6 +1014,26 @@
 		/* Register the Pool */
 		cert_pools = g_list_prepend(cert_pools, pool);
 
+		/* TODO: Emit a signal that the pool got registered */
+
+		purple_signal_register(pool, /* Signals emitted from pool */
+				       "certificate-stored",
+				       purple_marshal_VOID__POINTER_POINTER,
+				       NULL, /* No callback return value */
+				       2,    /* Two non-data arguments */
+				       purple_value_new(PURPLE_TYPE_SUBTYPE,
+							PURPLE_SUBTYPE_CERTIFICATEPOOL),
+				       purple_value_new(PURPLE_TYPE_STRING));
+
+		purple_signal_register(pool, /* Signals emitted from pool */
+				       "certificate-deleted",
+				       purple_marshal_VOID__POINTER_POINTER,
+				       NULL, /* No callback return value */
+				       2,    /* Two non-data arguments */
+				       purple_value_new(PURPLE_TYPE_SUBTYPE,
+							PURPLE_SUBTYPE_CERTIFICATEPOOL),
+				       purple_value_new(PURPLE_TYPE_STRING));
+		
 		return TRUE;
 	} else {
 		return FALSE;
@@ -1047,6 +1068,8 @@
 	cert_pools = g_list_remove(cert_pools, pool);
 	
 	/* TODO: Signalling? */
+	purple_signal_unregister(pool, "certificate-stored");
+	purple_signal_unregister(pool, "certificate-deleted");
 		
 	return TRUE;
 }
--- a/libpurple/value.h	Fri Jul 27 04:38:56 2007 +0000
+++ b/libpurple/value.h	Fri Jul 27 06:56:00 2007 +0000
@@ -77,7 +77,8 @@
 	PURPLE_SUBTYPE_SAVEDSTATUS,
 	PURPLE_SUBTYPE_XMLNODE,
 	PURPLE_SUBTYPE_USERINFO,
-	PURPLE_SUBTYPE_STORED_IMAGE
+	PURPLE_SUBTYPE_STORED_IMAGE,
+	PURPLE_SUBTYPE_CERTIFICATEPOOL
 } PurpleSubType;
 
 /**