User offline status when set to not display online status
I have built a custom online user panel using REST v2 and one of my testers found that their avatar is showing up in the list when they have gone to their settings and set it so they are shown as offline to everyone.
Is there a way I can check this users settings in my loop and not display them? I can't see anything in the Liql query results that would indicate their setting to display as offline.
This also leads on to something of a similar vein.. what do I do about it when a user has changed their setting to only display their online status for 'friends'? Here is a basic skeleton of my code which has the api call and loop...
<#assign query = "SELECT login, view_href, avatar, online_status, registration_data, rank FROM users limit 1000" /> <#assign res = restadmin("2.0", "/search?q=${query?url}").data.items /> <#assign users_id = [] /> <#list res as user> <#if user.online_status = 'online' & user.registration_data.status = 'fully-registered'> <a class="${rankClass}" href="${user.view_href}"><img src="${user.avatar.message}" title="${user.login}" alt="${user.login}" /></a> </#if> </#list>
If anyone has any ideas how I can not include a user who has set their preferences to not show up as online and even restrict their online status to their friends I would greatly appreciate it!