[next] telepathy-glib: client-factory: add abstract method creating TpTLSCertificate proxies

Guillaume Desmottes gdesmott at kemper.freedesktop.org
Mon Mar 17 07:25:42 PDT 2014


Module: telepathy-glib
Branch: next
Commit: 70041cc95f73210fde840649769eb877170206c9
URL:    http://cgit.freedesktop.org/telepathy/telepathy-glib/commit/?id=70041cc95f73210fde840649769eb877170206c9

Author: Guillaume Desmottes <guillaume.desmottes at collabora.co.uk>
Date:   Thu Mar 13 12:52:53 2014 +0100

client-factory: add abstract method creating TpTLSCertificate proxies

---

 telepathy-glib/client-factory.c |   15 ++++++++++++++-
 telepathy-glib/client-factory.h |    6 ++++++
 2 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/telepathy-glib/client-factory.c b/telepathy-glib/client-factory.c
index 17f1dd8..4dfa419 100644
--- a/telepathy-glib/client-factory.c
+++ b/telepathy-glib/client-factory.c
@@ -95,6 +95,8 @@
  * @create_protocol: create a #TpProtocol;
  *  see tp_client_factory_ensure_protocol()
  * @dup_protocol_features: implementation of tp_client_factory_dup_protocol_features()
+ * @create_tls_certificate: create a #TpTLSCertificate;
+ *  see tp_client_factory_ensure_tls_certificate()
  *
  * The class structure for #TpClientFactory.
  *
@@ -402,6 +404,15 @@ dup_protocol_features_impl (TpClientFactory *self,
       (GQuark *) self->priv->desired_protocol_features->data);
 }
 
+static TpTLSCertificate *
+create_tls_certificate_impl (TpClientFactory *self,
+    TpProxy *conn_or_chan,
+    const gchar *object_path,
+    GError **error)
+{
+  return tp_tls_certificate_new (conn_or_chan, object_path, error);
+}
+
 static void
 tp_client_factory_class_init (TpClientFactoryClass *klass)
 {
@@ -425,6 +436,7 @@ tp_client_factory_class_init (TpClientFactoryClass *klass)
   klass->dup_contact_features = dup_contact_features_impl;
   klass->create_protocol = create_protocol_impl;
   klass->dup_protocol_features = dup_protocol_features_impl;
+  klass->create_tls_certificate = create_tls_certificate_impl;
 
   /**
    * TpClientFactory:dbus-daemon:
@@ -1510,7 +1522,8 @@ tp_client_factory_ensure_tls_certificate (TpClientFactory *self,
     }
   else
     {
-      cert = tp_tls_certificate_new (conn_or_chan, object_path, error);
+      cert = TP_CLIENT_FACTORY_GET_CLASS (self)->create_tls_certificate (self,
+        conn_or_chan, object_path, error);
       insert_proxy (self, cert);
     }
 
diff --git a/telepathy-glib/client-factory.h b/telepathy-glib/client-factory.h
index cd06548..3eef940 100644
--- a/telepathy-glib/client-factory.h
+++ b/telepathy-glib/client-factory.h
@@ -87,6 +87,12 @@ struct _TpClientFactoryClass {
     GArray * (*dup_protocol_features) (TpClientFactory *self,
         TpProtocol *protocol);
 
+    /* TpTLSCertificate */
+    TpTLSCertificate * (*create_tls_certificate) (TpClientFactory *self,
+        TpProxy *conn_or_chan,
+        const gchar *object_path,
+        GError **error);
+
     /*<private>*/
     GCallback padding[20];
 };



More information about the telepathy-commits mailing list