]> git.0d.be Git - empathy.git/commitdiff
chat-manager: use tp_channel_join_async()
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Tue, 1 May 2012 10:55:49 +0000 (12:55 +0200)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Thu, 3 May 2012 08:53:34 +0000 (10:53 +0200)
It's basically the same as empathy_tp_chat_join()

https://bugzilla.gnome.org/show_bug.cgi?id=675229

src/empathy-chat-manager.c

index dd828fa68c5872b78cae4eea24c455a3e7818b35..6a163aaae8e3dd5707a91e938ee938cb237fc006 100644 (file)
@@ -135,6 +135,22 @@ chat_destroyed_cb (gpointer data,
       priv->num_displayed_chat);
 }
 
+static void
+join_cb (GObject *source,
+    GAsyncResult *result,
+    gpointer user_data)
+{
+  TpChannel *channel = TP_CHANNEL (source);
+  GError *error = NULL;
+
+  if (!tp_channel_join_finish (channel, result, &error))
+    {
+      DEBUG ("Failed to join chat (%s): %s",
+          tp_channel_get_identifier (channel), error->message);
+      g_error_free (error);
+    }
+}
+
 static void
 process_tp_chat (EmpathyChatManager *self,
     EmpathyTpChat *tp_chat,
@@ -193,7 +209,7 @@ process_tp_chat (EmpathyChatManager *self,
     {
       /* We have been invited to the room. Add ourself as member as this
        * channel has been approved. */
-      empathy_tp_chat_join (tp_chat);
+      tp_channel_join_async (TP_CHANNEL (tp_chat), "", join_cb, self);
     }
 }