static void _handle_user_add ( InputUser *user, gboolean write_nfc) { GumUser *guser = NULL; guser = gum_user_create_sync (offline_mode); if (!guser) return; _set_user_prop (guser, user); if (!gum_user_add_sync (guser)) { INFO ("Failed user add setup"); g_object_unref (guser); return; } INFO ("User added successfully"); _print_user_prop (guser); if (write_nfc) { _handle_write_nfc(guser); } g_object_unref (guser); }
static gboolean _setup_guest_account ( TlmAccountPlugin *plugin, const gchar *user_name) { g_return_val_if_fail (plugin && TLM_IS_ACCOUNT_PLUGIN_GUMD(plugin), FALSE); g_return_val_if_fail (user_name && user_name[0], FALSE); GumUser *guser = gum_user_create_sync (FALSE); if (!guser) { WARN ("Failed user %s creation", user_name); return FALSE; } g_object_set (G_OBJECT (guser), "usertype", GUM_USERTYPE_GUEST, "username", user_name, NULL); if (!gum_user_add_sync (guser)) { WARN ("Failed user %s add", user_name); g_object_unref (guser); return FALSE; } g_object_unref (guser); return TRUE; }