Quantcast

Learn to test

Erik L. Vonderscheer [11-24-08 - 04:38]
Learn to test
Filename
TradeFilter.lua
diff --git a/TradeFilter.lua b/TradeFilter.lua
index 7a17e70..e6c0211 100644
--- a/TradeFilter.lua
+++ b/TradeFilter.lua
@@ -54,7 +54,7 @@ local L = Rock("LibRockLocale-1.0"):GetTranslationNamespace("TradeFilter")
 TradeFilter = Rock:NewAddon("TradeFilter", "LibRockDB-1.0", "LibRockConfig-1.0", "LibRockEvent-1.0", "LibRockHook-1.0", "LibRockTimer-1.0", "LibRockConsole-1.0")

 local MAJOR_VERSION = "1.1"
-local MINOR_VERSION = 000 + tonumber(("$Revision: 32 $"):match("%d+"))
+local MINOR_VERSION = 000 + tonumber(("$Revision: 34 $"):match("%d+"))
 TradeFilter.version = MAJOR_VERSION .. "." .. MINOR_VERSION
 TradeFilter.date = string.sub("$Date: 2008-11-21 12:00:00 -0800 (Fri, 21 Nov 2008) $", 8, 17)

@@ -413,35 +413,28 @@ local function PreFilter_OnEvent(...)
 		arg8:	channel number
 	]]
 	local zoneID = select(8, ...)
-
-	--[[ Check for General Channel and User setting ]]--
-	if (zoneID == 1 and TradeFilter:IsFilterGeneral()) then
-		TradeFilter:TradeFilter_OnEvent()
-	else
-		filtered = false
-	end
 	--[[ Check for Trade Channel and User setting ]]--
 	if (zoneID == 2 and TradeFilter:IsFilterTrade()) then
 		TradeFilter:TradeFilter_OnEvent()
 	elseif (zoneID == 2 and not TradeFilter:IsFilterTrade()) then
 		filtered = false
 	end
-	--[[ Check for LFG Channel and User setting ]]--
-	if (zoneID == 4 and TradeFilter:IsFilterLFG()) then
+	--[[ Check for General Channel and User setting ]]--
+	if (zoneID == 1 and TradeFilter:IsFilterGeneral()) then
 		TradeFilter:TradeFilter_OnEvent()
-	else
+	elseif (zoneID == 1 and not TradeFilter:IsFilterGeneral()) then
 		filtered = false
 	end
-	--[[ Check for test Channel and User setting ]]--
-	if (zoneID == 5 and TradeFilter:IsFilterGeneral()) then
-		TradeFilter:TradeFilter_OnEvent(...)
-	else
+	--[[ Check for LFG Channel and User setting ]]--
+	if (zoneID == 4 and TradeFilter:IsFilterLFG()) then
+		TradeFilter:TradeFilter_OnEvent()
+	elseif (zoneID == 1 and not TradeFilter:IsFilterLFG()) then
 		filtered = false
 	end
 	--[[ Check for SAY Channel and User setting ]]--
-	if (TradeFilter:IsFilterSAY()) then
+	if (zoneID == 0 and TradeFilter:IsFilterSAY()) then
 		TradeFilter:TradeFilter_OnEvent()
-	elseif (not TradeFilter:IsFilterSAY()) then
+	elseif (zoneID == 0 and not TradeFilter:IsFilterSAY()) then
 		filtered = false
 	end
 	return filtered
@@ -501,6 +494,7 @@ function TradeFilter:TradeFilter_OnEvent(...)
 			end
 		end
 	end
+	return filtered
 end

 --[[ Pass ALL chat messages to PreFilter function ]]--