Mercurial > wow > itemauditor
comparison Modules/Events.lua @ 6:5dddd73b2220
Removed dependency on postal. It was only being used to determine the mail type which has been moved into ItemAuditor so I can support CODPayments. Paying for COD items works, but getting the payments back can't reliably associate the payment with an item yet.
| author | Asa Ayers <Asa.Ayers@Gmail.com> |
|---|---|
| date | Wed, 26 May 2010 22:41:47 -0700 |
| parents | 7d0f4ebedf8c |
| children | bbba2fae0f69 |
comparison
equal
deleted
inserted
replaced
| 5:7d0f4ebedf8c | 6:5dddd73b2220 |
|---|---|
| 25 end | 25 end |
| 26 | 26 |
| 27 function addon:MAIL_INBOX_UPDATE() | 27 function addon:MAIL_INBOX_UPDATE() |
| 28 local newScan = addon:ScanMail() | 28 local newScan = addon:ScanMail() |
| 29 local diff | 29 local diff |
| 30 for item, total in pairs(self.lastMailScan) do | 30 for mailType, collection in pairs(self.lastMailScan) do |
| 31 for item, total in pairs(collection) do | |
| 31 | 32 |
| 32 if newScan[item] == nil then | 33 diff = total - (newScan[mailType][item] or 0) |
| 33 newScan[item] = 0 | 34 if diff ~= 0 then |
| 35 self:SaveValue(item, diff) | |
| 36 end | |
| 37 | |
| 34 end | 38 end |
| 35 diff = total - newScan[item] | |
| 36 if diff ~= 0 then | |
| 37 self:SaveValue(item, diff) | |
| 38 end | |
| 39 | |
| 40 end | 39 end |
| 41 | 40 |
| 42 self.lastMailScan = newScan | 41 self.lastMailScan = newScan |
| 43 end | 42 end |
| 44 | 43 |
