Commit 6eb45f9f authored by Ray Strode's avatar Ray Strode

lib: filter out duplicate "new-user" messages from accountsservice

AccountsService occassionally sends out a new-user message twice in
a row for a particular user. There's probably a bug there, but for
now be more vigilant about filtering out the spurious message.
parent ef43b993
......@@ -1057,6 +1057,25 @@ out:
}
}
static ActUser *
find_new_user_with_object_path (ActUserManager *manager,
const char *object_path)
{
GSList *node;
g_assert (object_path != NULL);
for (node = manager->priv->new_users; node != NULL; node = node->next) {
ActUser *user = ACT_USER (node->data);
const char *user_object_path = act_user_get_object_path (user);
if (g_strcmp0 (user_object_path, object_path) == 0) {
return user;
}
}
return NULL;
}
static ActUser *
add_new_user_for_object_path (const char *object_path,
ActUserManager *manager)
......@@ -1071,6 +1090,14 @@ add_new_user_for_object_path (const char *object_path,
return user;
}
user = find_new_user_with_object_path (manager, object_path);
if (user != NULL) {
g_debug ("ActUserManager: tracking existing (but very recently added) %s with object path %s",
describe_user (user), object_path);
return user;
}
g_debug ("ActUserManager: tracking new user with object path %s", object_path);
user = create_new_user (manager);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment