changeset 19050:c563b8f84aa0

- Only emit certificate-stored and certificate-deleted if the operation succeeds
author William Ehlhardt <williamehlhardt@gmail.com>
date Fri, 27 Jul 2007 07:33:52 +0000
parents 8cbc110456ac
children c0ccfe389b23
files libpurple/certificate.c
diffstat 1 files changed, 10 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/certificate.c	Fri Jul 27 07:31:47 2007 +0000
+++ b/libpurple/certificate.c	Fri Jul 27 07:33:52 2007 +0000
@@ -338,9 +338,11 @@
 
 	ret = (pool->put_cert)(id, crt);
 
-	/* Signal that the certificate was stored */
-	purple_signal_emit(pool, "certificate-stored",
-			   pool, id);
+	/* Signal that the certificate was stored if success*/
+	if (ret) {
+		purple_signal_emit(pool, "certificate-stored",
+				   pool, id);
+	}
 
 	return ret;
 }	
@@ -356,9 +358,11 @@
 
 	ret = (pool->delete_cert)(id);
 
-	/* Signal that the certificate was deleted */
-	purple_signal_emit(pool, "certificate-deleted",
-			   pool, id);
+	/* Signal that the certificate was deleted if success */
+	if (ret) {
+		purple_signal_emit(pool, "certificate-deleted",
+				   pool, id);
+	}
 
 	return ret;
 }