[empathy] Use the EmpathyChannelFactory with all components creating EmpathyTpChat



commit 64d8e268e6be5afc2afd80ff93d9803318dc5953
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Fri Feb 11 14:29:02 2011 +0100

    Use the EmpathyChannelFactory with all components creating EmpathyTpChat

 libempathy/empathy-chatroom-manager.c |    8 ++++++++
 src/empathy-chat-manager.c            |    9 +++++++++
 src/empathy-event-manager.c           |    8 ++++++++
 3 files changed, 25 insertions(+), 0 deletions(-)
---
diff --git a/libempathy/empathy-chatroom-manager.c b/libempathy/empathy-chatroom-manager.c
index 7872bbb..5378634 100644
--- a/libempathy/empathy-chatroom-manager.c
+++ b/libempathy/empathy-chatroom-manager.c
@@ -37,6 +37,7 @@
 
 #include "empathy-tp-chat.h"
 #include "empathy-chatroom-manager.h"
+#include "empathy-channel-factory.h"
 #include "empathy-utils.h"
 
 #define DEBUG_FLAG EMPATHY_DEBUG_OTHER
@@ -538,6 +539,7 @@ empathy_chatroom_manager_constructor (GType type,
   EmpathyChatroomManagerPriv *priv;
   GError *error = NULL;
   TpDBusDaemon *dbus;
+  EmpathyChannelFactory *factory;
 
   if (chatroom_manager_singleton != NULL)
     return g_object_ref (chatroom_manager_singleton);
@@ -597,6 +599,11 @@ empathy_chatroom_manager_constructor (GType type,
   tp_base_client_add_connection_features_varargs (priv->observer,
       TP_CONNECTION_FEATURE_CAPABILITIES, NULL);
 
+  factory = empathy_channel_factory_dup ();
+
+  tp_base_client_set_channel_factory (priv->observer,
+      TP_CLIENT_CHANNEL_FACTORY (factory));
+
   if (!tp_base_client_register (priv->observer, &error))
     {
       g_critical ("Failed to register Observer: %s", error->message);
@@ -604,6 +611,7 @@ empathy_chatroom_manager_constructor (GType type,
       g_error_free (error);
     }
 
+  g_object_unref (factory);
   return obj;
 }
 
diff --git a/src/empathy-chat-manager.c b/src/empathy-chat-manager.c
index d8e5733..8bdc97e 100644
--- a/src/empathy-chat-manager.c
+++ b/src/empathy-chat-manager.c
@@ -20,6 +20,7 @@
 #include <telepathy-glib/telepathy-glib.h>
 #include <telepathy-glib/proxy-subclass.h>
 
+#include <libempathy/empathy-channel-factory.h>
 #include <libempathy/empathy-chatroom-manager.h>
 #include <libempathy/empathy-request-util.h>
 #include <libempathy/empathy-utils.h>
@@ -303,6 +304,7 @@ empathy_chat_manager_init (EmpathyChatManager *self)
   EmpathyChatManagerPriv *priv = GET_PRIV (self);
   TpDBusDaemon *dbus;
   GError *error = NULL;
+  EmpathyChannelFactory *factory;
 
   priv->closed_queue = g_queue_new ();
   priv->messages = g_hash_table_new_full (g_str_hash, g_str_equal,
@@ -345,11 +347,18 @@ empathy_chat_manager_init (EmpathyChatManager *self)
         TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_NONE,
         NULL));
 
+  factory = empathy_channel_factory_dup ();
+
+  tp_base_client_set_channel_factory (priv->handler,
+      TP_CLIENT_CHANNEL_FACTORY (factory));
+
   if (!tp_base_client_register (priv->handler, &error))
     {
       g_critical ("Failed to register text handler: %s", error->message);
       g_error_free (error);
     }
+
+  g_object_unref (factory);
 }
 
 static void
diff --git a/src/empathy-event-manager.c b/src/empathy-event-manager.c
index f75fbc5..770b22b 100644
--- a/src/empathy-event-manager.c
+++ b/src/empathy-event-manager.c
@@ -29,6 +29,7 @@
 #include <telepathy-glib/interfaces.h>
 #include <telepathy-glib/simple-approver.h>
 
+#include <libempathy/empathy-channel-factory.h>
 #include <libempathy/empathy-presence-manager.h>
 #include <libempathy/empathy-tp-contact-factory.h>
 #include <libempathy/empathy-contact-manager.h>
@@ -1249,6 +1250,7 @@ empathy_event_manager_init (EmpathyEventManager *manager)
     EMPATHY_TYPE_EVENT_MANAGER, EmpathyEventManagerPriv);
   TpDBusDaemon *dbus;
   GError *error = NULL;
+  EmpathyChannelFactory *factory;
 
   manager->priv = priv;
 
@@ -1332,6 +1334,11 @@ empathy_event_manager_init (EmpathyEventManager *manager)
           TP_IFACE_CHANNEL_INTERFACE_SASL_AUTHENTICATION,
         NULL));
 
+  factory = empathy_channel_factory_dup ();
+
+  tp_base_client_set_channel_factory (priv->approver,
+      TP_CLIENT_CHANNEL_FACTORY (factory));
+
   if (!tp_base_client_register (priv->approver, &error))
     {
       DEBUG ("Failed to register Approver: %s", error->message);
@@ -1344,6 +1351,7 @@ empathy_event_manager_init (EmpathyEventManager *manager)
       g_error_free (error);
     }
 
+  g_object_unref (factory);
   g_object_unref (dbus);
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]