View Single Post
09-23-14, 10:16 AM   #13
Duugu
Premium Member
 
Duugu's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 851
Remove the local keyword from
Lua Code:
  1. local function Accountant_DetectAhMail()
There's another problem. You can't check on MAIL_SHOW as this event is triggered if the inbox is opened. There won't be any data at this point as the client needs a moment to query the mail data from the server.
Use MAIL_INBOX_UPDATE instead:
Lua Code:
  1. elseif event == "MAIL_INBOX_UPDATE" then
  2.         Accountant_DetectAhMail();
and add
Lua Code:
  1. self:RegisterEvent("MAIL_INBOX_UPDATE");
to Accountant_RegisterEvents(self)
  Reply With Quote