# HG changeset patch # User Asa Ayers # Date 1278865473 25200 # Node ID 554b30908b33c90caa09fc0f554e2ec1d2a45270 # Parent 819bfdc5d73c9d7a0d4eea4a8e4c0257ddfb870f - Fixed a bug with the mail where items get recorded by the mail scanner and the bag scanner. - Fixed some minor issues not visible to the user. diff -r 819bfdc5d73c -r 554b30908b33 CHANGELOG.txt --- a/CHANGELOG.txt Thu Jul 08 23:55:05 2010 -0700 +++ b/CHANGELOG.txt Sun Jul 11 09:24:33 2010 -0700 @@ -1,3 +1,8 @@ +2010-07-11 Asa Ayers + +- Fixed a bug with the mail where items get recorded by the mail scanner and the bag scanner. +- Fixed some minor issues not visible to the user. + 2010-07-08 Asa Ayers - Added a (hopefully) more readable changelog. diff -r 819bfdc5d73c -r 554b30908b33 Core.lua --- a/Core.lua Thu Jul 08 23:55:05 2010 -0700 +++ b/Core.lua Sun Jul 11 09:24:33 2010 -0700 @@ -69,9 +69,10 @@ self:RefreshQAGroups() end -function addon:Print(message) - local prefix = "|cFFA3CEFF"..tostring( self ).."|r: " - DEFAULT_CHAT_FRAME:AddMessage( prefix .. tostring(message)) +local printPrefix = "|cFFA3CEFFItemAuditor|r: " +function addon:Print(message, ...) + message = format(message, ...) + DEFAULT_CHAT_FRAME:AddMessage( printPrefix .. tostring(message)) self:Log(message) end @@ -177,8 +178,8 @@ elseif mailType == "AHExpired" or mailType == "AHCancelled" or mailType == "AHOutbid" then -- These should be handled when you pay the deposit at the AH else - self:Debug("Unhandled mail type: " .. mailType) - self:Debug(msgSubject) + -- self:Debug("Unhandled mail type: " .. mailType) + -- self:Debug(msgSubject) end end @@ -200,7 +201,6 @@ local itemName = nil if self:GetSafeLink(link) == nil then itemName = link - link = self:GetSafeLink(link) else link = self:GetSafeLink(link) itemName = GetItemInfo(link) @@ -216,8 +216,7 @@ end if viewOnly == false and self.items[link] == nil then - local itemName = GetItemInfo(link) - + self.items[link] = { count = Altoholic:GetItemCount(self:GetIDFromLink(link)), invested = abs(self.db.factionrealm.item_account[itemName] or 0), @@ -242,6 +241,8 @@ link = self:GetSafeLink(link) if link ~= nil then self.items[link] = nil + else + self:Debug('Failed to convert link' .. tostring(link)) end end @@ -305,7 +306,9 @@ function addon:GetSafeLink(link) local newLink = nil - if link and link ~= string.match(link, '.-:[-0-9]+[:0-9]*') then + if link and link == string.match(link, '.-:[-0-9]+[:0-9]*') then + newLink = link + elseif link then newLink = link and string.match(link, "|H(.-):([-0-9]+):([0-9]+)|h") end if newLink == nil then diff -r 819bfdc5d73c -r 554b30908b33 Modules/Debug.lua --- a/Modules/Debug.lua Thu Jul 08 23:55:05 2010 -0700 +++ b/Modules/Debug.lua Sun Jul 11 09:24:33 2010 -0700 @@ -4,7 +4,8 @@ local utils = addonTable.utils -function addon:Debug(msg) +function addon:Debug(msg, ...) + msg = format(msg, ...) self:Log(msg, " |cffffff00DEBUG") end diff -r 819bfdc5d73c -r 554b30908b33 Modules/Events.lua --- a/Modules/Events.lua Thu Jul 08 23:55:05 2010 -0700 +++ b/Modules/Events.lua Sun Jul 11 09:24:33 2010 -0700 @@ -6,6 +6,7 @@ function addon:PLAYER_ENTERING_WORLD() self:RegisterEvent("MAIL_SHOW") self:RegisterEvent("UNIT_SPELLCAST_START") + addon:UpdateCurrentInventory() self:WatchBags() -- addon:ConvertItems() @@ -13,6 +14,7 @@ function addon:MAIL_SHOW() self:Debug("MAIL_SHOW") + addon:UpdateCurrentInventory() self.lastMailScan = self:ScanMail() self:UnregisterEvent("MAIL_SHOW") diff -r 819bfdc5d73c -r 554b30908b33 Modules/QuickAuctions.lua --- a/Modules/QuickAuctions.lua Thu Jul 08 23:55:05 2010 -0700 +++ b/Modules/QuickAuctions.lua Sun Jul 11 09:24:33 2010 -0700 @@ -94,7 +94,7 @@ if addon.IsQAEnabled() then - self:Debug(format("Auction Threshold: %d%%", self:GetAuctionThreshold()*100 )) + self:Debug("Auction Threshold: %d%%", self:GetAuctionThreshold()*100 ) end self:Debug(format("Crafting Threshold: %s", self:FormatMoney(self:GetCraftingThreshold()))) local profitableItems = {} diff -r 819bfdc5d73c -r 554b30908b33 Modules/Utils.lua --- a/Modules/Utils.lua Thu Jul 08 23:55:05 2010 -0700 +++ b/Modules/Utils.lua Sun Jul 11 09:24:33 2010 -0700 @@ -92,7 +92,7 @@ item_db[itemName] = tonumber(id) end -local SubjectPatterns = { +addon.SubjectPatterns = { AHCancelled = gsub(AUCTION_REMOVED_MAIL_SUBJECT, "%%s", ".*"), AHExpired = gsub(AUCTION_EXPIRED_MAIL_SUBJECT, "%%s", ".*"), AHOutbid = gsub(AUCTION_OUTBID_MAIL_SUBJECT, "%%s", ".*"), @@ -103,7 +103,7 @@ function addon:GetMailType(msgSubject) if msgSubject then - for k, v in pairs(SubjectPatterns) do + for k, v in pairs(self.SubjectPatterns) do if msgSubject:find(v) then return k end end end