]> git.0d.be Git - empathy.git/commitdiff
Dispatch existing channels once we initialize the connection.
authorCosimo Cecchi <cosimoc@gnome.org>
Tue, 15 Sep 2009 13:33:54 +0000 (15:33 +0200)
committerCosimo Cecchi <cosimo.cecchi@collabora.co.uk>
Wed, 16 Sep 2009 11:20:27 +0000 (13:20 +0200)
libempathy/empathy-dispatcher.c

index 18647e4e22f38bf2e3c10d6918ac34ae5dd371df..0cd490b86a672359efdd0a1027c6750470cd2c0a 100644 (file)
@@ -748,6 +748,7 @@ dispatcher_connection_got_all (TpProxy *proxy,
   EmpathyDispatcher *dispatcher = EMPATHY_DISPATCHER (object);
   EmpathyDispatcherPriv *priv = GET_PRIV (dispatcher);
   GPtrArray *requestable_channels;
+  GPtrArray *existing_channels;
 
   if (error) {
     DEBUG ("Error: %s", error->message);
@@ -792,6 +793,26 @@ dispatcher_connection_got_all (TpProxy *proxy,
 
       g_hash_table_remove (priv->outstanding_classes_requests, proxy);
     }
+
+  existing_channels = tp_asv_get_boxed (properties,
+      "Channels", TP_ARRAY_TYPE_CHANNEL_DETAILS_LIST);
+
+  if (existing_channels != NULL)
+    {
+      int idx;
+
+      for (idx = 0; idx < existing_channels->len; idx++)
+        {
+          GValueArray *values = g_ptr_array_index (existing_channels, idx);
+          const gchar *object_path;
+          GHashTable *properties;
+
+          object_path = g_value_get_boxed (g_value_array_get_nth (values, 0));
+          properties = g_value_get_boxed (g_value_array_get_nth (values, 1));
+          dispatcher_connection_new_channel_with_properties (dispatcher,
+              TP_CONNECTION (proxy), object_path, properties);
+        }
+    }
 }
 
 static void