View Single Post
02-06-13, 12:08 AM   #2
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
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/
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote