diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2011-02-04 22:24:36 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2011-02-24 17:11:56 +0800 |
commit | ffb89eff7654897d8d5246bc06840411ab1de13f (patch) | |
tree | 8b0fb4d1fd1f5d1db211421e61a3bf8dde012b51 /src | |
parent | c96c271f838ffa3911bd301b37b6c7aaffb2dfc2 (diff) | |
download | gsoc2013-empathy-ffb89eff7654897d8d5246bc06840411ab1de13f.tar gsoc2013-empathy-ffb89eff7654897d8d5246bc06840411ab1de13f.tar.gz gsoc2013-empathy-ffb89eff7654897d8d5246bc06840411ab1de13f.tar.bz2 gsoc2013-empathy-ffb89eff7654897d8d5246bc06840411ab1de13f.tar.lz gsoc2013-empathy-ffb89eff7654897d8d5246bc06840411ab1de13f.tar.xz gsoc2013-empathy-ffb89eff7654897d8d5246bc06840411ab1de13f.tar.zst gsoc2013-empathy-ffb89eff7654897d8d5246bc06840411ab1de13f.zip |
use tp_capabilities_supports_room_list() (#641491)
Diffstat (limited to 'src')
-rw-r--r-- | src/empathy-new-chatroom-dialog.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/src/empathy-new-chatroom-dialog.c b/src/empathy-new-chatroom-dialog.c index f0e58c749..edaeb0ea5 100644 --- a/src/empathy-new-chatroom-dialog.c +++ b/src/empathy-new-chatroom-dialog.c @@ -438,8 +438,7 @@ new_chatroom_dialog_account_changed_cb (GtkComboBox *combobox, gboolean listing = FALSE; gboolean expanded = FALSE; TpConnection *connection; - EmpathyDispatcher *dispatcher; - GList *classes = NULL; + TpCapabilities *caps; if (dialog->room_list) { g_object_unref (dialog->room_list); @@ -464,25 +463,21 @@ new_chatroom_dialog_account_changed_cb (GtkComboBox *combobox, dialog->status_changed_id = g_signal_connect (dialog->account, "status-changed", G_CALLBACK (account_status_changed_cb), dialog); - dispatcher = empathy_dispatcher_dup_singleton (); + /* empathy_account_chooser_filter_supports_chatrooms ensures that the + * account has a connection and CAPABILITIES has been prepared. */ + g_assert (connection != NULL); + g_assert (tp_proxy_is_prepared (connection, + TP_CONNECTION_FEATURE_CAPABILITIES)); + caps = tp_connection_get_capabilities (connection); - if (connection != NULL) { - classes = empathy_dispatcher_find_requestable_channel_classes (dispatcher, - connection, TP_IFACE_CHANNEL_TYPE_ROOM_LIST, - TP_HANDLE_TYPE_NONE, NULL); - } - - if (classes != NULL) { + if (tp_capabilities_supports_room_list (caps, NULL)) { /* Roomlist channels are supported */ dialog->room_list = empathy_tp_roomlist_new (dialog->account); - g_list_free (classes); } else { dialog->room_list = NULL; } - g_object_unref (dispatcher); - if (dialog->room_list) { g_signal_connect (dialog->room_list, "destroy", G_CALLBACK (new_chatroom_dialog_roomlist_destroy_cb), |