# HG changeset patch # User William Ehlhardt # Date 1185521507 0 # Node ID 8cbc110456ac5f6670e8769ed7858e2115adfbb6 # Parent fd0b4b2f6cf039e75a0e509a7096363e5fb370ff - Add purple_certificate_pool_delete diff -r fd0b4b2f6cf0 -r 8cbc110456ac libpurple/certificate.c --- a/libpurple/certificate.c Fri Jul 27 07:27:34 2007 +0000 +++ b/libpurple/certificate.c Fri Jul 27 07:31:47 2007 +0000 @@ -345,6 +345,24 @@ return ret; } +gboolean +purple_certificate_pool_delete(PurpleCertificatePool *pool, const gchar *id) +{ + gboolean ret = FALSE; + + g_return_val_if_fail(pool, FALSE); + g_return_val_if_fail(id, FALSE); + g_return_val_if_fail(pool->delete_cert, FALSE); + + ret = (pool->delete_cert)(id); + + /* Signal that the certificate was deleted */ + purple_signal_emit(pool, "certificate-deleted", + pool, id); + + return ret; +} + GList * purple_certificate_pool_get_idlist(PurpleCertificatePool *pool) { @@ -614,6 +632,7 @@ x509_tls_peers_cert_in_pool, /* Certificate exists? */ x509_tls_peers_get_cert, /* Cert retriever */ x509_tls_peers_put_cert, /* Cert writer */ + x509_tls_peers_delete_cert, /* Cert remover */ x509_tls_peers_get_idlist /* idlist retriever */ }; diff -r fd0b4b2f6cf0 -r 8cbc110456ac libpurple/certificate.h --- a/libpurple/certificate.h Fri Jul 27 07:27:34 2007 +0000 +++ b/libpurple/certificate.h Fri Jul 27 07:31:47 2007 +0000 @@ -118,6 +118,8 @@ * @return TRUE if the operation succeeded, otherwise FALSE */ gboolean (* put_cert)(const gchar *id, PurpleCertificate *crt); + /** Delete a certificate from the pool */ + gboolean (* delete_cert)(const gchar *id); /** Returns a list of IDs stored in the pool */ GList * (* get_idlist)(void); @@ -538,6 +540,16 @@ purple_certificate_pool_store(PurpleCertificatePool *pool, const gchar *id, PurpleCertificate *crt); /** + * Remove a certificate from a pool + * + * @param pool Pool to remove from + * @param id ID to remove + * @return TRUE if the operation succeeded, otherwise FALSE + */ +gboolean +purple_certificate_pool_delete(PurpleCertificatePool *pool, const gchar *id); + +/** * Get the list of IDs currently in the pool. * * @param pool Pool to enumerate