-- WHO_LIST_UPDATE
function()
    for i = 1, GetNumWhoResults() do
        local name, guild, level, race, class, zone = GetWhoInfo(i)
		if not aura_env.ignored[name] then
			---@type WHOQuery
			local query = aura_env.lastQuery
			if not query then
				print("No query wtf?")
				return
			end
			---@type WHOFilter[]
			local filters = query.filters
			for _, filter in pairs(filters) do
				if not filter(name, guild, level, race, class, zone) then
					--print("Filter failed", filter, name, guild, level, race, class,
					--      zone)
					return
				end
			end

			local timestamp = date("%Y-%m-%dT%H:%M:%S")
			local player = aura_env.stinkies[name]
			if not player then
				player = Player.new(name, guild, race, class, zone)
				local existing = WeakAurasSaved.Cyka.WhoSniffer[name]

				if not existing then WeakAurasSaved.Cyka.WhoSniffer[name] = {}
				else
					player.lastSeen = existing.lastSeen or "never"
					player.firstSeen = existing.firstSeen or "never"
					player.seenCount = existing.seenCount or 0
				end
				if player.firstSeen == "never" then
					player.firstSeen = timestamp
				end

				local stinky = WeakAurasSaved.Cyka.stinkies[name]
				if stinky then
					PlaySoundFile("Interface\\Sounds\\Domination.ogg", "Master")
				else
					PlaySoundFile("Interface\\Sounds\\Cloak.ogg", "Master")
				end

				aura_env.Notify(player)
				player.lastSeen = timestamp
				player.seenCount = player.seenCount + 1
				WeakAurasSaved.Cyka.WhoSniffer[name] = player
			end
			player.lastSeenInternal = GetTime()
			if player.zone ~= zone then
				aura_env.NotifyZoneChanged(player, zone)
			end
			player.zone = zone
			player.lastSeen = timestamp
			aura_env.stinkies[name] = player
		end
	end
    -- Turns out WA cannot do this (
    -- aura_env.UpdateMacro()
    _G["FriendsFrameCloseButton"]:Click()
end

-- /run WeakAurasSaved.Cyka.WhoSniffer = {}
