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;

	protocol = tp_account_get_protocol (dialog->account);

	gtk_entry_set_text (GTK_ENTRY (dialog->entry_server), "");

	/* hardcode here known protocols */
	if (strcmp (protocol, "jabber") == 0) {
		gtk_widget_set_sensitive (dialog->entry_server, TRUE);
	}
	else if (strcmp (protocol, "local-xmpp") == 0) {
		gtk_widget_set_sensitive (dialog->entry_server, FALSE);
	}
	else if (strcmp (protocol, "irc") == 0) {
		gtk_widget_set_sensitive (dialog->entry_server, FALSE);
	}
	else {
		gtk_widget_set_sensitive (dialog->entry_server, TRUE);
	}

	update_join_button_sensitivity (dialog);

	/* Final set up of the dialog */
	gtk_widget_grab_focus (dialog->entry_room);
}
static void
new_chatroom_dialog_entry_changed_cb (GtkWidget                *entry,
				      EmpathyNewChatroomDialog *dialog)
{
	if (entry == dialog->entry_room) {
		update_join_button_sensitivity (dialog);

		/* FIXME: Select the room in the list */
	}
}
static void
account_status_changed_cb (TpAccount *account,
			    guint old_status,
			    guint new_status,
			    guint reason,
			    gchar *dbus_error_name,
			    GHashTable *details,
			    EmpathyNewChatroomDialog *self)
{
	update_join_button_sensitivity (self);
}
static void
new_chatroom_dialog_update_widgets (EmpathyNewChatroomDialog *dialog)
{
	const gchar           *protocol;

	if (dialog->account == NULL)
		return;

	protocol = tp_account_get_protocol (dialog->account);

	gtk_entry_set_text (GTK_ENTRY (dialog->entry_server), "");

	/* hardcode here known protocols */
	if (strcmp (protocol, "jabber") == 0) {
		gtk_widget_set_sensitive (dialog->entry_server, TRUE);
	}
	else if (strcmp (protocol, "local-xmpp") == 0) {
		gtk_widget_set_sensitive (dialog->entry_server, FALSE);
	}
	else if (strcmp (protocol, "irc") == 0) {
		gtk_widget_set_sensitive (dialog->entry_server, FALSE);
	}
	else {
		gtk_widget_set_sensitive (dialog->entry_server, TRUE);
	}

	if (!tp_strdiff (protocol, "irc"))
		gtk_entry_set_text (GTK_ENTRY (dialog->entry_room), "#");
	else
		gtk_entry_set_text (GTK_ENTRY (dialog->entry_room), "");

	update_join_button_sensitivity (dialog);

	/* Final set up of the dialog */
	gtk_widget_grab_focus (dialog->entry_room);
	gtk_editable_set_position (GTK_EDITABLE (dialog->entry_room), -1);
}