# HG changeset patch # User Zerotorescue # Date 1296336259 -3600 # Node ID debff5ad3de4428b60c8c498027efff86ae8c789 # Parent 2c6184c5619257ae0b672977a1c11762a828b9dd Possible issue with the overriding of the CheckInbox function where the first call to it after a login might not work might have been fixed. (I can?t reproduce it, but can see the potential for problems) diff -r 2c6184c56192 -r debff5ad3de4 Core.lua --- a/Core.lua Mon Dec 20 14:22:04 2010 +0100 +++ b/Core.lua Sat Jan 29 22:24:19 2011 +0100 @@ -335,6 +335,10 @@ self.btnConfig:Show(); + -- Reset variables + lastAmount = 0; + self.debugChannel = nil; + if not originalCheckInbox then -- Override the CheckInbox function -- Remember the original @@ -343,10 +347,6 @@ CheckInbox = NewCheckInbox; end - -- Reset variables - lastAmount = 0; - self.debugChannel = nil; - -- If we were toggling this addon on while the mailbox is opened we must register all events again if MailFrame:IsVisible() then self:MAIL_SHOW(); @@ -818,7 +818,7 @@ -- This should speed things up a tiny bit, but might become buggy if coded wrong -- We actually override the function in the onenable function NewCheckInbox(...) - if not MailOpener.db.profile.general.overrideCheckInbox or not MailOpener.db.profile.general.continueOpening or lastAmount == 0 then + if not MailOpener.db.profile.general.overrideCheckInbox or not MailOpener.db.profile.general.continueOpening or not lastAmount or lastAmount == 0 then -- If the override Check Inbox option is off -- or continuous opening is off -- or there's currently no mail visible @@ -841,4 +841,4 @@ return originalCheckInbox(...); end -end \ No newline at end of file +end