WoWInterface SVN StopTradeSpam

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 44 to Rev 45
    Reverse comparison

Rev 44 → Rev 45

trunk/StopTradeSpam/init.lua
1,4 → 1,4
local version = 7.0
local version = tonumber(strmatch(GetAddOnMetadata("StopTradeSpam","Version"),"^%d+.(%d+.%d+)"))
 
function STS_InitSV()
if not STS_SV then
trunk/StopTradeSpam/StopTradeSpam.lua
1,4 → 1,4
local version = 7.0
local version = 7.1
sts_session_all = 0
sts_session_filtered = 0
sts_last_action = 0
99,11 → 99,12
end
 
function STS_List(...)
local list = select(1,...)
if list == "white" or list == "black" then
dcfa(gsub(list,"^%a",strupper).."list entrys:") --TODO: locale
local list = "list"
if select(1,...) then list = select(1,...) end
if list == "white" or list == "black" or list == "list" then
dcfa("List entrys:") --TODO: locale
for le,lv in pairs(STS_SV[sts_lang]["list"]) do
if (list == "white" and lv < 0) or (list == "black" and lv > 0) then
if (list == "white" and lv < 0) or (list == "black" and lv > 0) or list == "list" then
dcfa("\""..le.."\" : "..lv)
end
end
119,11 → 120,14
end
end
 
function STS_Find(key, list)
function STS_Find(...)
local key = select(1,...)
local list = "list"
if select(2,...) then list = select(2,...) end
if list == "white" or list == "black" then
dcfa(gsub(list,"^%a",strupper).."list entrys:") --TODO: locale
dcfa("List entrys:") --TODO: locale
for le,lv in pairs(STS_SV[sts_lang]["list"]) do
if key == le and ((list == "white" and lv < 0) or (list == "black" and lv > 0)) then
if key == le and ((list == "white" and lv < 0) or (list == "black" and lv > 0) or list == "list") then
dcfa("\""..le.."\" : "..lv)
return i
end
135,7 → 139,7
if key == "raid" then
imax = 40
end
dcfa("Following persons in this "..key.." are T-ignored:") --TODO: locale
dcfa("Following persons in this party/raid are T-ignored:") --TODO: locale
for i=1,imax do
if STS_SV["ignore"][tignlist][UnitName(key..i)] then
spammers = spammers..STS_ColoredNameLink(nil,UnitName(key..i))..", "
148,7 → 152,7
if spammers ~= "" then
dcfa(strsub(spammers,1,-3))
else
dcfa("No one in your "..key.." is T-ignored.") --TODO: locale
dcfa("No one in this party/raid is T-ignored.") --TODO: locale
end
elseif list == "ignore" then
if STS_SV["ignore"][tignlist][key] then
215,7 → 219,10
local list = select(2,...)
local val = 0
if select(3,...) then
select(3,...)
val = select(3,...)
elseif type(select(2,...)) == "number" then
val = select(2,...)
list = "list"
else
if list == "white" then val = -2
elseif list == "black" then val = 1
223,19 → 230,22
end
if not key then
dcfa("Wrong parameters. Use /sts add white [entry] or /sts add black [entry].")
elseif list == "white" or list == "black" then
elseif list == "white" or list == "black" or list == "list" then
STS_SV[sts_lang]["list"][key] = val
dcfa("Filter added to "..list.."list: "..key) --TODO: locale and value
dcfa("Filter added: \""..key.."\" with value "..val) --TODO: locale
return true
else
dcfa("Wrong parameters. Use /sts add white [entry] or /sts add black [entry] .")--TODO: locale and explain new
dcfa("Wrong parameters. Use /sts add <valueOrList> <entry> .")--TODO: locale
end
return false
end
 
function STS_Remove(key, list)
if list ~= "white" and list ~= "black" then
dcfa("Wrong parameters. Use /sts remove white [entry] or /sts remove black [entry] .")--TODO: change function and locale
function STS_Remove(...)
local key = select(1,...)
local list = "list"
if select(2,...) then list = select(2,...) end
if not key then
dcfa("Wrong parameters. Use /sts remove [list] <entry> .")--TODO: change function and locale
return false
end
--[[ has to be rewritten TODO!!!
345,7 → 355,11
elseif STScommand[1] == "add" then
STS_Add(strsub(argument, 2 + select(2, strfind(argument, STScommand[2], 1))), STScommand[2])
elseif STScommand[1] == "del" or STScommand[1] == "remove" then
STS_Remove(strsub(argument, 2 + select(2, strfind(argument, STScommand[2], 1))), STScommand[2])
if STScommand[3] then
STS_Remove(strsub(argument, 2 + select(2, strfind(argument, STScommand[2], 1))), STScommand[2])
else
STS_Remove(strsub(argument, 2 + select(2, strfind(argument, STScommand[1], 1))))
end
elseif STScommand[1] == "ignore" then
if STScommand[3] then
STS_AddIgnore(STScommand[2], strsub(argument, 9 + strlen(STScommand[2])))
trunk/StopTradeSpam/StopTradeSpam.toc
2,7 → 2,7
## Title: StopTradeSpam
## Notes: Detect spam in trade-channel based on a blacklist and a whitelist, adding a trade-ignorelist.
## Author: Meredy-Das Syndikat (EU)
## Version: 0.6.8.wowi:revision
## Version: 0.7.1.wowi:revision
## eMail: zam@abwesend.de
## DefaultState: Enabled
## SavedVariables: STS_SV