#include <glib/gi18n.h>
#include <glib/gprintf.h>
-#include <libmissioncontrol/mission-control.h>
-#include <libmissioncontrol/mc-account.h>
-#include <libmissioncontrol/mc-profile.h>
-
#include <libempathy/empathy-tp-roomlist.h>
#include <libempathy/empathy-chatroom.h>
#include <libempathy/empathy-utils.h>
new_chatroom_dialog_update_widgets (EmpathyNewChatroomDialog *dialog)
{
EmpathyAccountChooser *account_chooser;
- McAccount *account;
- McProfile *profile;
+ EmpathyAccount *account;
const gchar *protocol;
const gchar *room;
-
+
account_chooser = EMPATHY_ACCOUNT_CHOOSER (dialog->account_chooser);
account = empathy_account_chooser_dup_account (account_chooser);
- profile = mc_account_get_profile (account);
- protocol = mc_profile_get_protocol_name (profile);
+ protocol = empathy_account_get_protocol (account);
gtk_entry_set_text (GTK_ENTRY (dialog->entry_server), "");
gtk_widget_grab_focus (dialog->entry_room);
g_object_unref (account);
- g_object_unref (profile);
}
static void
EmpathyNewChatroomDialog *dialog)
{
EmpathyAccountChooser *account_chooser;
- McAccount *account;
+ EmpathyAccount *account;
gboolean listing = FALSE;
gboolean expanded = FALSE;
if (dialog->room_list) {
g_object_unref (dialog->room_list);
+ dialog->room_list = NULL;
}
ephy_spinner_stop (EPHY_SPINNER (dialog->throbber));
account_chooser = EMPATHY_ACCOUNT_CHOOSER (dialog->account_chooser);
account = empathy_account_chooser_dup_account (account_chooser);
+ if (account == NULL)
+ goto out;
+
dialog->room_list = empathy_tp_roomlist_new (account);
if (dialog->room_list) {
}
}
- new_chatroom_dialog_update_widgets (dialog);
-
g_object_unref (account);
+
+out:
+ new_chatroom_dialog_update_widgets (dialog);
}
static void
/* Update the throbber */
if (listing) {
- ephy_spinner_start (EPHY_SPINNER (dialog->throbber));
+ ephy_spinner_start (EPHY_SPINNER (dialog->throbber));
} else {
ephy_spinner_stop (EPHY_SPINNER (dialog->throbber));
}
static void
new_chatroom_dialog_model_selection_changed (GtkTreeSelection *selection,
EmpathyNewChatroomDialog *dialog)
-{
+{
GtkTreeModel *model;
GtkTreeIter iter;
gchar *room = NULL;