Make agent tracker sniff channel messages for agents
This commit is contained in:
@@ -21,6 +21,19 @@ function shared.AgentTracker.Init()
|
||||
end
|
||||
--shared.dumpTable(Heimdall_Data.config.agents)
|
||||
end)
|
||||
|
||||
local agentTrackerChannelSniffer = CreateFrame("Frame")
|
||||
agentTrackerChannelSniffer:RegisterEvent("CHAT_MSG_CHANNEL")
|
||||
agentTrackerChannelSniffer:SetScript("OnEvent", function(self, event, msg, sender, ...)
|
||||
if not Heimdall_Data.config.agentTracker.enabled then return end
|
||||
local channelId = select(6, ...)
|
||||
local channelname = GetChannelName(channelId)
|
||||
if not channelname then return end
|
||||
if channelname ~= Heimdall_Data.config.who.notifyChannel then return end
|
||||
local agentName = sender
|
||||
if not agentName then return end
|
||||
Heimdall_Data.config.agents[agentName] = date("%Y-%m-%dT%H:%M:%S")
|
||||
end)
|
||||
|
||||
print("Heimdall - AgentTracker loaded")
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user