[empathy/mc5] Ensure that the connection data is setup when handle channels



commit 7894d6060831bbb8134386cb24e1cf741a146ace
Author: Sjoerd Simons <sjoerd simons collabora co uk>
Date:   Sun Aug 23 23:15:29 2009 +0100

    Ensure that the connection data is setup when handle channels

 libempathy/empathy-dispatcher.c |   19 ++++++++++++++++---
 1 files changed, 16 insertions(+), 3 deletions(-)
---
diff --git a/libempathy/empathy-dispatcher.c b/libempathy/empathy-dispatcher.c
index 465f23b..c1a19f6 100644
--- a/libempathy/empathy-dispatcher.c
+++ b/libempathy/empathy-dispatcher.c
@@ -104,6 +104,10 @@ enum
 static guint signals[LAST_SIGNAL];
 static EmpathyDispatcher *dispatcher = NULL;
 
+static void dispatcher_init_connection_if_needed (
+    EmpathyDispatcher *dispatcher,
+    TpConnection *connection);
+
 static GList * empathy_dispatcher_find_channel_classes
   (EmpathyDispatcher *dispatcher, TpConnection *connection,
    const gchar *channel_type, guint handle_type, GArray *fixed_properties);
@@ -590,6 +594,8 @@ dispatcher_connection_new_channel (EmpathyDispatcher *dispatcher,
     NULL
   };
 
+  dispatcher_init_connection_if_needed (dispatcher, connection);
+
   cd = g_hash_table_lookup (priv->connections, connection);
 
   /* Don't bother with channels we have already dispatched or are dispatching
@@ -784,9 +790,8 @@ dispatcher_connection_advertise_capabilities_cb (TpConnection    *connection,
 }
 
 static void
-dispatcher_new_connection_cb (EmpathyAccountManager *manager,
-                              TpConnection *connection,
-                              EmpathyDispatcher *dispatcher)
+dispatcher_init_connection_if_needed (EmpathyDispatcher *dispatcher,
+    TpConnection *connection)
 {
   EmpathyDispatcherPriv *priv = GET_PRIV (dispatcher);
   GPtrArray   *capabilities;
@@ -836,6 +841,14 @@ dispatcher_new_connection_cb (EmpathyAccountManager *manager,
 }
 
 static void
+dispatcher_new_connection_cb (EmpathyAccountManager *manager,
+                              TpConnection *connection,
+                              EmpathyDispatcher *dispatcher)
+{
+  dispatcher_init_connection_if_needed (dispatcher, connection);
+}
+
+static void
 remove_idle_handlers (gpointer key,
                       gpointer value,
                       gpointer user_data)



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