Implement message throttling for whispers
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -212,7 +212,7 @@ for i, part in ipairs(stinkies) do
|
||||
end
|
||||
end
|
||||
|
||||
local killSpamTime = 30
|
||||
local killSpamTime = 10
|
||||
local recentlyKilled = {}
|
||||
aura_env.RegisterKill = function(source, destination, spellName, overkill)
|
||||
if recentlyKilled[source] and recentlyKilled[source] > GetTime() - killSpamTime then
|
||||
@@ -238,14 +238,18 @@ aura_env.localStinkies = {}
|
||||
---@param name string
|
||||
aura_env.StinkyDetected = function(name)
|
||||
if aura_env.config.debug then print(string.format("StinkyDetected (%s)", name)) end
|
||||
local stinky = aura_env.stinkies[name]
|
||||
if not aura_env.localStinkies[name] or aura_env.localStinkies[name] <
|
||||
GetTime() - aura_env.config.messageThrottle then
|
||||
local stinky = aura_env.stinkies[name]
|
||||
Message.QueueNotifyGuild(stinky)
|
||||
Message.QueueNotifyWhisper(stinky)
|
||||
end
|
||||
if not aura_env.localStinkies[name] or aura_env.localStinkies[name] <
|
||||
GetTime() - aura_env.config.messageThrottleAddon then
|
||||
Message.QueueNotifyAddonGuild(stinky)
|
||||
Message.QueueNotifyAddonWhisper(stinky)
|
||||
end
|
||||
WeakAuras.ScanEvents("CHAT_MSG_ADDON", aura_env.addonprefix, stinky:FormAddonMessage())
|
||||
aura_env.localStinkies[name] = GetTime()
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user