Originally Posted by Phanx
If you want to see all types of links:
Code:
ChatFrame_AddMessageEventFilter("CHAT_MSG_CHANNEL", function(_, _, message, _, _, _, _, _, _, _, channel)
if channel == "Trade - City" and not message:find("|H") then
return true
end
end)
If you only want to see specific types of links (eg. only item, enchant, and tradeskill links):
Code:
local AllowedLinkTypes = {
enchant = true,
item = true,
trade = true,
}
ChatFrame_AddMessageEventFilter("CHAT_MSG_CHANNEL", function(_, _, message, _, _, _, _, _, _, _, channel)
if channel == "Trade - City" then
local linkType = message:match("|H(.-):") or "none"
return not AllowedLinkTypes[linkType]
end
end)
For either, change "Trade - City" to the full name of the trade channel in your language.
If you need help turning the above code into an addon, copy and paste it into this page:
http://addon.ziuo.net/
|
That post is a near revelation - for the code and the link.
I tweaked the product of that site, so the TOC and LUA shared the same name, but the automation it makes possible is a great help.
I'm going to test the addon now
Thanks.
EDIT:
It works. I prefer the first - as it does just what I wanted, in a micro fashion - but I have some ideas (for the second and in general) and so sent you a PM.