From af04c329970278385dab9170ce8022c93b4bb21a Mon Sep 17 00:00:00 2001 From: Abhay agarwal Date: Thu, 20 Jun 2019 15:46:46 +0530 Subject: [PATCH] Fixed duplicate entries for absent users Change-Id: I820b4c3d3fe6af79629fecd998b253fe615ffed6 Signed-off-by: Abhay agarwal --- ua-daemon/src/ua-manager-core.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ua-daemon/src/ua-manager-core.c b/ua-daemon/src/ua-manager-core.c index bee54c5..d17cfa9 100644 --- a/ua-daemon/src/ua-manager-core.c +++ b/ua-daemon/src/ua-manager-core.c @@ -2320,8 +2320,10 @@ static void __send_user_absence_event(uam_tech_type_e type, unsigned int sensor) present_users = g_slist_prepend(present_users, tech->device->user); } else { /* If user not in the present list then only add it to absent list */ - if (!l2) - absent_users = g_slist_prepend(absent_users, tech->device->user); + if ((NULL == l2) && (NULL == g_slist_find_custom( + absent_users, &(tech->device->user->user_id), + __compare_user_id))) + absent_users = g_slist_prepend(absent_users, tech->device->user); } } -- 2.7.4