on_setup_for_user (GdmSessionWorker *worker,
                   DBusMessage      *message)
{
        DBusError   error;
        const char *service;
        const char *x11_display_name;
        const char *x11_authority_file;
        const char *console;
        const char *hostname;
        const char *username;
        dbus_bool_t res;

        if (worker->priv->state != GDM_SESSION_WORKER_STATE_NONE) {
                g_debug ("GdmSessionWorker: ignoring spurious setup for user while in state %s", get_state_name (worker->priv->state));
                return;
        }

        dbus_error_init (&error);
        res = dbus_message_get_args (message,
                                     &error,
                                     DBUS_TYPE_STRING, &service,
                                     DBUS_TYPE_STRING, &x11_display_name,
                                     DBUS_TYPE_STRING, &console,
                                     DBUS_TYPE_STRING, &hostname,
                                     DBUS_TYPE_STRING, &x11_authority_file,
                                     DBUS_TYPE_STRING, &username,
                                     DBUS_TYPE_INVALID);
        if (res) {
                worker->priv->service = g_strdup (service);
                worker->priv->x11_display_name = g_strdup (x11_display_name);
                worker->priv->x11_authority_file = g_strdup (x11_authority_file);
                worker->priv->display_device = g_strdup (console);
                worker->priv->hostname = g_strdup (hostname);
                worker->priv->username = g_strdup (username);

                g_debug ("GdmSessionWorker: queuing setup for user: %s %s", service, console);
                queue_state_change (worker);
        } else {
                g_warning ("Unable to get arguments: %s", error.message);
                dbus_error_free (&error);
        }
}
on_setup_for_user (GdmSessionWorker *worker,
                   DBusMessage      *message)
{
        DBusError   error;
        const char *service;
        const char *x11_display_name;
        const char *x11_authority_file;
        const char *console;
        const char *hostname;
        const char *username;
        dbus_bool_t res;

        if (worker->priv->state != GDM_SESSION_WORKER_STATE_NONE) {
                g_debug ("GdmSessionWorker: ignoring spurious setup for user while in state %s", get_state_name (worker->priv->state));
                return;
        }

        dbus_error_init (&error);
        res = dbus_message_get_args (message,
                                     &error,
                                     DBUS_TYPE_STRING, &service,
                                     DBUS_TYPE_STRING, &x11_display_name,
                                     DBUS_TYPE_STRING, &console,
                                     DBUS_TYPE_STRING, &hostname,
                                     DBUS_TYPE_STRING, &x11_authority_file,
                                     DBUS_TYPE_STRING, &username,
                                     DBUS_TYPE_INVALID);
        if (res) {
                worker->priv->service = g_strdup (service);
                worker->priv->x11_display_name = g_strdup (x11_display_name);
                worker->priv->x11_authority_file = g_strdup (x11_authority_file);
                worker->priv->display_device = g_strdup (console);
                worker->priv->hostname = g_strdup (hostname);
                worker->priv->username = g_strdup (username);

                g_debug ("GdmSessionWorker: queuing setup for user: %s %s", service, console);
                queue_state_change (worker);
        } else {
                g_warning ("Unable to get arguments: %s", error.message);
                dbus_error_free (&error);
        }
}