Skip to content

Commit 7105392

Browse files
committed
Handle UnitIsAFK and UnitIsDND secret values in 12.0.1
No more knowing AFK info during battlegrounds Fixes #24
1 parent 3ec6898 commit 7105392

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Categories/Status.lua

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ local UnitName, UnitInRaid, UnitFactionGroup, GetPVPTimer, IsPVPTimerRunning, Ge
1919

2020
DogTag_Unit_funcs[#DogTag_Unit_funcs+1] = function(DogTag_Unit, DogTag)
2121

22+
local issecretvalue = DogTag.issecretvalue
2223
local L = DogTag_Unit.L
2324
local GetNameServer = DogTag_Unit.GetNameServer
2425

@@ -92,7 +93,8 @@ local function PARTY_MEMBERS_CHANGED(event)
9293
afkTimes[guid] = nil
9394
else
9495
offlineTimes[guid] = nil
95-
if UnitIsAFK(unit) then
96+
local afk = UnitIsAFK(unit)
97+
if not issecretvalue(afk) and afk then
9698
if not afkTimes[guid] then
9799
afkTimes[guid] = GetTime()
98100
end
@@ -179,7 +181,8 @@ DogTag:AddEventHandler("Unit", "EventRequested", function(_, event)
179181
end
180182
end
181183

182-
if UnitIsAFK(unit) then
184+
local afk = UnitIsAFK(unit)
185+
if not issecretvalue(afk) and afk then
183186
if not afkTimes[guid] then
184187
afkTimes[guid] = GetTime()
185188
end
@@ -308,7 +311,8 @@ DogTag:AddTag("Unit", "AFK", {
308311

309312
DogTag:AddTag("Unit", "DND", {
310313
code = function(unit)
311-
if UnitIsDND(unit) then
314+
local dnd = UnitIsDND(unit)
315+
if not issecretvalue(dnd) and dnd then
312316
return L["DND"]
313317
else
314318
return nil

0 commit comments

Comments
 (0)