changeset 19515:b62683f4120d

There's some disagreement over the response-id sent to the callbacks to purple_request_action. The best fix is to not use the same callback. Fix this so when I click 'Yes', purple doesn't think I REJECTED the certification.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Tue, 28 Aug 2007 21:17:28 +0000
parents 7b348650524e
children e1751162ab1f e2b7dadac415
files libpurple/certificate.c
diffstat 1 files changed, 14 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/certificate.c	Tue Aug 28 21:03:49 2007 +0000
+++ b/libpurple/certificate.c	Tue Aug 28 21:17:28 2007 +0000
@@ -1124,6 +1124,18 @@
 	}
 }
 
+static void
+x509_tls_cached_user_auth_accept_cb(x509_tls_cached_ua_ctx *c, gint ignore)
+{
+	x509_tls_cached_user_auth_cb(c, 2);
+}
+
+static void
+x509_tls_cached_user_auth_reject_cb(x509_tls_cached_ua_ctx *c, gint ignore)
+{
+	x509_tls_cached_user_auth_cb(c, 1);
+}
+
 /** Validates a certificate by asking the user
  * @param reason    String to explain why the user needs to accept/refuse the
  *                  certificate.
@@ -1151,8 +1163,8 @@
 		NULL,         /* No associated conversation */
 		x509_tls_cached_ua_ctx_new(vrq, reason),
 		3,            /* Number of actions */
-		_("Yes"), x509_tls_cached_user_auth_cb,
-		_("No"),  x509_tls_cached_user_auth_cb,
+		_("Yes"), x509_tls_cached_user_auth_accept_cb,
+		_("No"),  x509_tls_cached_user_auth_reject_cb,
 		_("_View Certificate..."), x509_tls_cached_show_cert);
 	
 	/* Cleanup */