From 4f5bfccceec4707e5e3a6ca3596ff9fb88507464 Mon Sep 17 00:00:00 2001 From: Sjoerd Simons Date: Fri, 9 Jan 2009 16:13:04 +0000 Subject: Use new dispatcher API to get muc channels Signed-off-by: Sjoerd Simons svn path=/trunk/; revision=2145 --- libempathy-gtk/empathy-chat.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'libempathy-gtk/empathy-chat.c') diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c index d05c8591d..a1787189a 100644 --- a/libempathy-gtk/empathy-chat.c +++ b/libempathy-gtk/empathy-chat.c @@ -40,6 +40,7 @@ #include #include #include +#include #include "empathy-chat.h" #include "empathy-conf.h" @@ -179,21 +180,21 @@ chat_connection_changed_cb (EmpathyAccountManager *manager, if (current == TP_CONNECTION_STATUS_CONNECTED && !priv->tp_chat && empathy_account_equal (account, priv->account) && priv->handle_type != TP_HANDLE_TYPE_NONE) { - TpConnection *connection; - MissionControl *mc; - + DEBUG ("Account reconnected, request a new Text channel"); - mc = empathy_mission_control_new (); - connection = mission_control_get_tpconnection (mc, account, NULL); - tp_connection_run_until_ready (connection, FALSE, NULL, NULL); - empathy_connection_request_channel (connection, -1, - TP_IFACE_CHANNEL_TYPE_TEXT, - priv->handle_type, - priv->id, TRUE, - NULL, NULL, NULL, NULL); - g_object_unref (connection); - g_object_unref (mc); + switch (priv->handle_type) { + case TP_HANDLE_TYPE_CONTACT: + empathy_dispatcher_chat_with_contact_id (account, unique_name, + NULL, NULL); + break; + case TP_HANDLE_TYPE_ROOM: + empathy_dispatcher_join_muc (account, unique_name, NULL, NULL); + break; + default: + g_assert_not_reached (); + break; + } } } -- cgit v1.2.3