#include <libempathy/empathy-tp-roomlist.h>
#include <libempathy/empathy-chatroom.h>
#include <libempathy/empathy-utils.h>
-#include <libempathy/empathy-dispatcher.h>
+#include <libempathy/empathy-request-util.h>
#include <libempathy-gtk/empathy-account-chooser.h>
#include <libempathy-gtk/empathy-ui-utils.h>
static void
new_chatroom_dialog_update_widgets (EmpathyNewChatroomDialog *dialog)
{
- EmpathyAccountChooser *account_chooser;
const gchar *protocol;
- account_chooser = EMPATHY_ACCOUNT_CHOOSER (dialog->account_chooser);
-
if (dialog->account == NULL)
return;
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);
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),
EmpathyChatroom *chatroom,
EmpathyNewChatroomDialog *dialog)
{
- GtkTreeView *view;
- GtkTreeSelection *selection;
GtkListStore *store;
GtkTreeIter iter;
gchar *members;
empathy_chatroom_get_room (chatroom));
/* Add to model */
- view = GTK_TREE_VIEW (dialog->treeview);
- selection = gtk_tree_view_get_selection (view);
store = GTK_LIST_STORE (dialog->model);
members = g_strdup_printf ("%d", empathy_chatroom_get_members_count (chatroom));
tmp = g_strdup_printf ("<b>%s</b>", empathy_chatroom_get_name (chatroom));
g_strstrip (room_name);
DEBUG ("Requesting channel for '%s'", room_name);
- empathy_dispatcher_join_muc (account, room_name,
- gtk_get_current_event_time ());
+
+ empathy_join_muc (account, room_name, empathy_get_current_action_time ());
g_free (room_name);
}