This site makes extensive use of JavaScript.
Please enable JavaScript in your browser.
Classic Theme
Thottbot Theme
Intercept chat messages
Post Reply
Return to board index
Post by
janniie
I've been looking for a way to intercept chat messages, mainly system messages and outgoing whispers.
I am putting a "mute" function in my AddOn and I want to hide the messages caused by the AddOn.
I have tried doing something with AddMessage function, without any success.
Post by
TheReal
I would think any development would begin with the CHAT_MSG_SYSTEM event. Because reporting a player for spam removes that player's messages from chat, I'm sure you could trigger message removal too. Sure, it's not message
prevention
per se, but it's something.
http://wowprogramming.com/docs/events/CHAT_MSG_SYSTEM
If I had more time I'd look more into it for you. Hope this helps.
Post by
janniie
Well prevention is not needed, I just want them to be hidden, even if that means they pop up a short time before being hidden. I've been looking alot in FrameXML\ChatFrame.lua in hope to find the function that removes messages but I havent found anything yet.
I don't believe CHAT_MSG_SYSTEM will be of any help since it's just an alert about what has happened, atleast no more help than to knowing when I need to hide something.
What would be great is if I could find and modify the function that puts the message in the ChatFrame. I was thinking of doing something like this:
local old = ThatFunction
local function ThatFunction(msg,...)
if mySettings.mute then
if strsub(msg,1,4) == "SomeID" then
return
end
end
old(msg,...)
end
Post by
lonewolfe31705
Swatter does something like this. I would say look at its' code and see how it does it.
Post by
pelf
Also, DBM blocks showing the messages it prints to the raid if that options is checked. You can check the code for that as well. In fact, it blocks showing any message that starts with "***" or "****" or some sequence of asterisks. I ran afoul of that with a macro of my own that I wrote where my
/ra
line wasn't showing up because DBM was blocking it because it matched the pattern it was looking for in its own messages.
Post Reply
You are not logged in. Please
log in
to post a reply or
register
if you don't already have an account.