diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2010-09-14 16:09:11 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2010-09-14 16:09:11 +0800 |
commit | 826cb45814d5fc9c6431454b673e2748f584d347 (patch) | |
tree | 7854423837cb6905b86340b34cdca9e4b243ca53 /libempathy | |
parent | 9d7af3cbb13bb74ccc28427a7261be514f7cb241 (diff) | |
parent | 923c077b85f4a6607e7e2ba0ea3a7f1c8b7d7ea1 (diff) | |
download | gsoc2013-empathy-826cb45814d5fc9c6431454b673e2748f584d347.tar gsoc2013-empathy-826cb45814d5fc9c6431454b673e2748f584d347.tar.gz gsoc2013-empathy-826cb45814d5fc9c6431454b673e2748f584d347.tar.bz2 gsoc2013-empathy-826cb45814d5fc9c6431454b673e2748f584d347.tar.lz gsoc2013-empathy-826cb45814d5fc9c6431454b673e2748f584d347.tar.xz gsoc2013-empathy-826cb45814d5fc9c6431454b673e2748f584d347.tar.zst gsoc2013-empathy-826cb45814d5fc9c6431454b673e2748f584d347.zip |
Merge remote branch 'cosimo/tls-multireject'
Diffstat (limited to 'libempathy')
-rw-r--r-- | libempathy/empathy-tls-certificate.c | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/libempathy/empathy-tls-certificate.c b/libempathy/empathy-tls-certificate.c index ca107008a..931bbcc64 100644 --- a/libempathy/empathy-tls-certificate.c +++ b/libempathy/empathy-tls-certificate.c @@ -374,6 +374,25 @@ empathy_tls_certificate_accept_finish (EmpathyTLSCertificate *self, return TRUE; } +static GPtrArray * +build_rejections_array (EmpTLSCertificateRejectReason reason, + GHashTable *details) +{ + GPtrArray *retval; + GValueArray *rejection; + + retval = g_ptr_array_new (); + rejection = tp_value_array_build (3, + G_TYPE_UINT, reason, + G_TYPE_STRING, reject_reason_get_dbus_error (reason), + TP_HASH_TYPE_STRING_VARIANT_MAP, details, + NULL); + + g_ptr_array_add (retval, rejection); + + return retval; +} + void empathy_tls_certificate_reject_async (EmpathyTLSCertificate *self, EmpTLSCertificateRejectReason reason, @@ -381,20 +400,23 @@ empathy_tls_certificate_reject_async (EmpathyTLSCertificate *self, GAsyncReadyCallback callback, gpointer user_data) { - const gchar *dbus_error; + GPtrArray *rejections; GSimpleAsyncResult *reject_result; g_assert (EMPATHY_IS_TLS_CERTIFICATE (self)); DEBUG ("Rejecting TLS certificate with reason %u", reason); - dbus_error = reject_reason_get_dbus_error (reason); + rejections = build_rejections_array (reason, details); reject_result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, empathy_tls_certificate_reject_async); emp_cli_authentication_tls_certificate_call_reject (TP_PROXY (self), - -1, reason, dbus_error, details, cert_proxy_reject_cb, + -1, rejections, cert_proxy_reject_cb, reject_result, g_object_unref, G_OBJECT (self)); + + tp_clear_boxed (EMP_ARRAY_TYPE_TLS_CERTIFICATE_REJECTION_LIST, + &rejections); } gboolean |