[empathy/next: 9/11] tp-chat: prepare GROUP if needed



commit 4565a79febd9eac1bfa940cdb70bc50c7bf49005
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Thu Oct 24 15:47:33 2013 +0200

    tp-chat: prepare GROUP if needed
    
    GROUP is no longer a part of CORE so we have to prepare it manually.

 libempathy/empathy-tp-chat.c |   26 +++++++++++++++++++++++++-
 1 files changed, 25 insertions(+), 1 deletions(-)
---
diff --git a/libempathy/empathy-tp-chat.c b/libempathy/empathy-tp-chat.c
index 5a40dbb..718082e 100644
--- a/libempathy/empathy-tp-chat.c
+++ b/libempathy/empathy-tp-chat.c
@@ -1429,6 +1429,16 @@ continue_preparing (EmpathyTpChat *self)
 }
 
 static void
+channel_group_prepared_cb (GObject *source,
+    GAsyncResult *result,
+    gpointer user_data)
+{
+  EmpathyTpChat *self = user_data;
+
+  continue_preparing (self);
+}
+
+static void
 conn_connected_cb (GObject *source,
     GAsyncResult *result,
     gpointer user_data)
@@ -1445,7 +1455,21 @@ conn_connected_cb (GObject *source,
       return;
     }
 
-  continue_preparing (self);
+  if (tp_proxy_has_interface_by_id (self,
+        TP_IFACE_QUARK_CHANNEL_INTERFACE_GROUP))
+    {
+      /* If the channel is implementing Group, we need its feature prepared.
+       * We can't list it as a dependency on EMPATHY_TP_CHAT_FEATURE_READY as
+       * we still want to prepare the tp-chat feature on channel not
+       * implementing GROUP. */
+      GQuark features[] = { TP_CHANNEL_FEATURE_GROUP, 0 };
+
+      tp_proxy_prepare_async (self, features, channel_group_prepared_cb, self);
+    }
+  else
+    {
+      continue_preparing (self);
+    }
 }
 
 static void


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