View Single Post
11-18-14, 11:42 AM   #4
Rilgamon
Premium Member
 
Rilgamon's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 822
Lua Code:
  1. local postmaster = {
  2.     ['Der Postmeister'] = true,
  3.     ['The Postmaster'] = true,
  4. }
  5. local f=CreateFrame("Frame")
  6. f:SetScript("OnEvent", function(self,event)
  7.     for i=GetInboxNumItems(),1,-1 do
  8.         local packageIcon, stationeryIcon, sender, subject, money, CODAmount, daysLeft, hasItem, wasRead, wasReturned, textCreated, canReply, isGM =GetInboxHeaderInfo(i)
  9.         if(postmaster[sender]) then
  10.             if(money and money >0) then
  11.                 TakeInboxMoney(i)
  12.             end
  13.             if(hasItem) then
  14.                 for j = 1, ATTACHMENTS_MAX_RECEIVE do
  15.                     local name, texture, count, quality, canUse = GetInboxItem(i, j)
  16.                     if(name) then
  17.                         TakeInboxItem(i,j)
  18.                     end
  19.                 end
  20.             end
  21.             C_Timer.After(5, function() DeleteInboxItem(i) end)
  22.         end
  23.     end
  24. end
  25. 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:
  1. C_Timer.After(5, function() DeleteInboxItem(i) end)
__________________
The cataclysm broke the world ... and the pandas could not fix it!

Last edited by Rilgamon : 11-18-14 at 11:46 AM.
  Reply With Quote