View Single Post
Unread 02-06-13, 12:08 AM   #2
Phanx
A Pyroguard Emberseer
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 4,591
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/
__________________
Author/maintainer of Grid, PhanxChat, ShieldsUp, and many more.
Troubleshoot an addonTurn any code into an addonMore addon resources
Need help with your code? Post all of your actual code! Attach or paste your files.
Please don’t PM me about addon bugs or code questions. Post a comment or forum thread instead!
Phanx is offline   Reply With Quote