From caba7afcd3d753afad18b52c0114221a13d9fbd7 Mon Sep 17 00:00:00 2001
From: Moorea Tv <moorea@ymail.com>
Date: Fri, 7 Aug 2020 07:38:00 -0700
Subject: [PATCH] use a set for lowbid seen and fix the whisper

---
 AuctionDB/AuctionDB.lua | 9 +++++----
 ChangeLog.txt           | 3 +++
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/AuctionDB/AuctionDB.lua b/AuctionDB/AuctionDB.lua
index 16bd5b1..35624b4 100644
--- a/AuctionDB/AuctionDB.lua
+++ b/AuctionDB/AuctionDB.lua
@@ -177,7 +177,7 @@ ADB.buyoutProfit = 48 -- 48 copper
 ADB.bidProfit = 78 -- 78 copper
 ADB.lowBid = 10 -- display low bids on items without vendor price
 ADB.lowBidTime = 3 -- only 30,2h,8h for low bids
-ADB.lastLowBid = nil -- avoid spamming for hundreds of same
+ADB.seenLowBid = {} -- avoid spamming for hundreds of same
 
 -- ADB.sendTo = "OFFICER"
 
@@ -230,15 +230,15 @@ function ADB:checkAuction(timeLeft, itemCount, minBid, buyoutPrice, bidAmount, m
     return
   end
   if vendorUnitPrice == 0 and bid < ADB.lowBid and not ourBid and timeLeft <= ADB.lowBidTime then
-    if itemLink == ADB.lastLowBid then
+    if ADB.seenLowBid[itemLink] then
       ADB:Debug(2, "repeated lowbid on " .. itemLink)
       return
     end
-    ADB.lastLowBid = itemLink
+    ADB.seenLowBid[itemLink] = true
     ADB:PrintDefault("AHDB: |cFF8742f5Low bid|r Auction " .. itemLink .. "x% bid " .. GetCoinTextureString(bid), itemCount)
     -- Send to sendTo  -- GetCoinText
     if ADB.sendTo then
-      local tmsg = ADB:format("AHDB: Low bid Auction " .. itemLink .. "x% bid " .. GetCoinText(bid) .. " < vendor by ", itemCount)
+      local tmsg = ADB:format("AHDB: Low bid Auction " .. itemLink .. "x% bid " .. GetCoinText(bid), itemCount)
       SendChatMessage(tmsg, ADB.sendTo)
     end
   end
@@ -402,6 +402,7 @@ function ADB:MaybeStartScan(msg, nowarning)
 end
 
 function ADB:AHendOfScanCB()
+  ADB.seenLowBid = {}
   if ADB.autoSave then
     -- C_UI.Reload()
     ADB:Execute("/reload", L["Save the scan data to SavedVariables"], true)
diff --git a/ChangeLog.txt b/ChangeLog.txt
index 6c51a08..590bfd1 100644
--- a/ChangeLog.txt
+++ b/ChangeLog.txt
@@ -4,6 +4,9 @@ Coming next:
 - Your input/suggestions welcome !
 - See open issues for ideas https://github.com/mooreatv/AuctionDB/issues
 
+v1.03.01 Aug 8th 2020
+- Misc dev mode improvements: Seen filter for lowbid is now a set and corrected whisper message.
+
 v1.03.00 July 24th 2020
 - Auction Item Database schema v5, now contains itemSellPrice, itemStackCount, itemClassID,
   itemSubClassID, itemRarity, itemMinLevel prefix before the link (MoLib change)