Lua Code:
local postmaster = {
['Der Postmeister'] = true,
['The Postmaster'] = true,
}
local f=CreateFrame("Frame")
f:SetScript("OnEvent", function(self,event)
for i=GetInboxNumItems(),1,-1 do
local packageIcon, stationeryIcon, sender, subject, money, CODAmount, daysLeft, hasItem, wasRead, wasReturned, textCreated, canReply, isGM =GetInboxHeaderInfo(i)
if(postmaster[sender]) then
if(money and money >0) then
TakeInboxMoney(i)
end
if(hasItem) then
for j = 1, ATTACHMENTS_MAX_RECEIVE do
local name, texture, count, quality, canUse = GetInboxItem(i, j)
if(name) then
TakeInboxItem(i,j)
end
end
end
C_Timer.After(5, function() DeleteInboxItem(i) end)
end
end
end
f:RegisterEvent("MAIL_INBOX_UPDATE")
You can alter the timer to fit your latency. Not sure if it would work to delete it without the delay.
Lua Code:
C_Timer.After(5, function() DeleteInboxItem(i) end)