]> git.0d.be Git - empathy.git/blobdiff - src/empathy-new-chatroom-dialog.c
Add en_GB in gitignore
[empathy.git] / src / empathy-new-chatroom-dialog.c
index 6aac17adaca8fbab4bce744c84848573187cd8d0..0d2452b6504265f4c894de48256f727571007f91 100644 (file)
@@ -39,6 +39,7 @@
 #include <libempathy/empathy-tp-roomlist.h>
 #include <libempathy/empathy-chatroom.h>
 #include <libempathy/empathy-utils.h>
+#include <libempathy/empathy-dispatcher.h>
 
 #include <libempathy-gtk/empathy-account-chooser.h>
 #include <libempathy-gtk/empathy-ui-utils.h>
@@ -331,7 +332,7 @@ new_chatroom_dialog_update_widgets (EmpathyNewChatroomDialog *dialog)
        }
 
        room = gtk_entry_get_text (GTK_ENTRY (dialog->entry_room));
-       gtk_widget_set_sensitive (dialog->button_join, !G_STR_EMPTY (room));
+       gtk_widget_set_sensitive (dialog->button_join, !EMP_STR_EMPTY (room));
 
        /* Final set up of the dialog */
        gtk_widget_grab_focus (dialog->entry_room);
@@ -366,7 +367,7 @@ new_chatroom_dialog_account_changed_cb (GtkComboBox             *combobox,
                g_signal_connect (dialog->room_list, "new-room",
                                  G_CALLBACK (new_chatroom_dialog_new_room_cb),
                                  dialog);
-               g_signal_connect (dialog->room_list, "notify::listing",
+               g_signal_connect (dialog->room_list, "notify::is-listing",
                                  G_CALLBACK (new_chatroom_dialog_listing_cb),
                                  dialog);
 
@@ -487,12 +488,11 @@ new_chatroom_dialog_model_selection_changed (GtkTreeSelection         *selection
 static void
 new_chatroom_dialog_join (EmpathyNewChatroomDialog *dialog)
 {
-       McAccount            *account;
        EmpathyAccountChooser *account_chooser;
-       MissionControl       *mc;
-       const gchar          *room;
-       const gchar          *server = NULL;
-       gchar                *room_name = NULL;
+       McAccount             *account;
+       const gchar           *room;
+       const gchar           *server = NULL;
+       gchar                 *room_name = NULL;
 
        room = gtk_entry_get_text (GTK_ENTRY (dialog->entry_room));
        server = gtk_entry_get_text (GTK_ENTRY (dialog->entry_server));
@@ -500,23 +500,16 @@ new_chatroom_dialog_join (EmpathyNewChatroomDialog *dialog)
        account_chooser = EMPATHY_ACCOUNT_CHOOSER (dialog->account_chooser);
        account = empathy_account_chooser_get_account (account_chooser);
 
-       if (!G_STR_EMPTY (server)) {
+       if (!EMP_STR_EMPTY (server)) {
                room_name = g_strconcat (room, "@", server, NULL);
        } else {
                room_name = g_strdup (room);
        }
 
        DEBUG ("Requesting channel for '%s'", room_name);
+       empathy_dispatcher_join_muc (account, room_name, NULL, NULL);
 
-       mc = empathy_mission_control_new ();
-       mission_control_request_channel_with_string_handle (mc,
-                                                           account,
-                                                           TP_IFACE_CHANNEL_TYPE_TEXT,
-                                                           room_name,
-                                                           TP_HANDLE_TYPE_ROOM,
-                                                           NULL, NULL);        
        g_free (room_name);
-       g_object_unref (mc);
 }
 
 static void
@@ -527,7 +520,7 @@ new_chatroom_dialog_entry_changed_cb (GtkWidget                *entry,
                const gchar *room;
 
                room = gtk_entry_get_text (GTK_ENTRY (dialog->entry_room));
-               gtk_widget_set_sensitive (dialog->button_join, !G_STR_EMPTY (room));
+               gtk_widget_set_sensitive (dialog->button_join, !EMP_STR_EMPTY (room));
                /* FIXME: Select the room in the list */
        }
 }