aboutsummaryrefslogtreecommitdiffstats
path: root/src/empathy.c
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@src.gnome.org>2008-04-11 21:11:06 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2008-04-11 21:11:06 +0800
commita0a612ae36134189ebb1de3647eca79e45d749e7 (patch)
tree40cccdcab90e0564454642d5e2fe141d654684c7 /src/empathy.c
parent8099574fb1fd23c010bf4e36f0d56d480f256284 (diff)
downloadgsoc2013-empathy-a0a612ae36134189ebb1de3647eca79e45d749e7.tar
gsoc2013-empathy-a0a612ae36134189ebb1de3647eca79e45d749e7.tar.gz
gsoc2013-empathy-a0a612ae36134189ebb1de3647eca79e45d749e7.tar.bz2
gsoc2013-empathy-a0a612ae36134189ebb1de3647eca79e45d749e7.tar.lz
gsoc2013-empathy-a0a612ae36134189ebb1de3647eca79e45d749e7.tar.xz
gsoc2013-empathy-a0a612ae36134189ebb1de3647eca79e45d749e7.tar.zst
gsoc2013-empathy-a0a612ae36134189ebb1de3647eca79e45d749e7.zip
Update for new API
svn path=/trunk/; revision=907
Diffstat (limited to 'src/empathy.c')
-rw-r--r--src/empathy.c38
1 files changed, 31 insertions, 7 deletions
diff --git a/src/empathy.c b/src/empathy.c
index fdde610eb..431d84bda 100644
--- a/src/empathy.c
+++ b/src/empathy.c
@@ -33,6 +33,8 @@
#include <libebook/e-book.h>
#include <telepathy-glib/util.h>
+#include <telepathy-glib/channel.h>
+#include <telepathy-glib/connection.h>
#include <libmissioncontrol/mc-account.h>
#include <libmissioncontrol/mission-control.h>
@@ -58,17 +60,36 @@ static BaconMessageConnection *connection = NULL;
static void
new_text_channel_cb (EmpathyChandler *chandler,
- TpConn *tp_conn,
- TpChan *tp_chan,
+ TpChannel *channel,
MissionControl *mc)
{
EmpathyTpChat *tp_chat;
+ TpConnection *connection;
+ guint handle_type;
+ guint handle;
+ gchar **names;
McAccount *account;
EmpathyChat *chat;
gchar *id;
-
- account = mission_control_get_account_for_connection (mc, tp_conn, NULL);
- id = empathy_inspect_channel (account, tp_chan);
+ GArray *handles;
+
+ g_object_get (channel,
+ "connection", &connection,
+ "handle-type", &handle_type,
+ "handle", &handle,
+ NULL);
+ handles = g_array_new (FALSE, FALSE, sizeof (guint));
+ g_array_append_val (handles, handle);
+ tp_cli_connection_run_inspect_handles (connection, -1,
+ handle_type, handles,
+ &names,
+ NULL, NULL);
+ id = *names;
+ g_free (names);
+ g_object_unref (connection);
+ g_array_free (handles, TRUE);
+
+ account = empathy_channel_get_account (channel);
chat = empathy_chat_window_find_chat (account, id);
g_free (id);
@@ -76,7 +97,8 @@ new_text_channel_cb (EmpathyChandler *chandler,
/* The chat already exists */
if (!empathy_chat_get_tp_chat (chat)) {
/* The chat died, give him the new text channel */
- tp_chat = empathy_tp_chat_new (account, tp_chan, TRUE);
+ tp_chat = empathy_tp_chat_new (channel, TRUE);
+ empathy_run_until_ready (tp_chat);
empathy_chat_set_tp_chat (chat, tp_chat);
g_object_unref (tp_chat);
}
@@ -86,7 +108,9 @@ new_text_channel_cb (EmpathyChandler *chandler,
return;
}
- tp_chat = empathy_tp_chat_new (account, tp_chan, TRUE);
+ tp_chat = empathy_tp_chat_new (channel, TRUE);
+ empathy_run_until_ready (tp_chat);
+
chat = empathy_chat_new (tp_chat);
empathy_chat_window_present_chat (chat);