diff options
author | Sjoerd Simons <sjoerd.simons@collabora.co.uk> | 2009-01-10 00:13:04 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@src.gnome.org> | 2009-01-10 00:13:04 +0800 |
commit | 4f5bfccceec4707e5e3a6ca3596ff9fb88507464 (patch) | |
tree | b49bd3148dde333d76161393f806479abea06075 /src/empathy-main-window.c | |
parent | 5436ecf05f66615d13540c19968361feda55c033 (diff) | |
download | gsoc2013-empathy-4f5bfccceec4707e5e3a6ca3596ff9fb88507464.tar gsoc2013-empathy-4f5bfccceec4707e5e3a6ca3596ff9fb88507464.tar.gz gsoc2013-empathy-4f5bfccceec4707e5e3a6ca3596ff9fb88507464.tar.bz2 gsoc2013-empathy-4f5bfccceec4707e5e3a6ca3596ff9fb88507464.tar.lz gsoc2013-empathy-4f5bfccceec4707e5e3a6ca3596ff9fb88507464.tar.xz gsoc2013-empathy-4f5bfccceec4707e5e3a6ca3596ff9fb88507464.tar.zst gsoc2013-empathy-4f5bfccceec4707e5e3a6ca3596ff9fb88507464.zip |
Use new dispatcher API to get muc channels
Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
svn path=/trunk/; revision=2145
Diffstat (limited to 'src/empathy-main-window.c')
-rw-r--r-- | src/empathy-main-window.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/empathy-main-window.c b/src/empathy-main-window.c index 4a6c86212..a20345e6d 100644 --- a/src/empathy-main-window.c +++ b/src/empathy-main-window.c @@ -31,6 +31,7 @@ #include <libempathy/empathy-contact.h> #include <libempathy/empathy-utils.h> #include <libempathy/empathy-account-manager.h> +#include <libempathy/empathy-dispatcher.h> #include <libempathy/empathy-chatroom-manager.h> #include <libempathy/empathy-chatroom.h> #include <libempathy/empathy-contact-list.h> @@ -49,6 +50,8 @@ #include <libempathy-gtk/empathy-new-message-dialog.h> #include <libempathy-gtk/empathy-gtk-enum-types.h> +#include <libmissioncontrol/mission-control.h> + #include "empathy-accounts-dialog.h" #include "empathy-main-window.h" #include "ephy-spinner.h" @@ -843,25 +846,20 @@ main_window_favorite_chatroom_join (EmpathyChatroom *chatroom) { MissionControl *mc; McAccount *account; - TpConnection *connection; const gchar *room; mc = empathy_mission_control_new (); account = empathy_chatroom_get_account (chatroom); room = empathy_chatroom_get_room (chatroom); + if (mission_control_get_connection_status (mc, account, NULL) != + TP_CONNECTION_STATUS_CONNECTED) { + return; + } + DEBUG ("Requesting channel for '%s'", room); + empathy_dispatcher_join_muc (account, room, NULL, NULL); - connection = mission_control_get_tpconnection (mc, account, NULL); - if (connection) { - tp_connection_run_until_ready (connection, TRUE, NULL, NULL); - empathy_connection_request_channel (connection, -1, - TP_IFACE_CHANNEL_TYPE_TEXT, - TP_HANDLE_TYPE_ROOM, - room, TRUE, - NULL, NULL, NULL, NULL); - g_object_unref (connection); - } g_object_unref (mc); } |