in your browser.
Intercept chat messages
Return to board index
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.
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
per se, but it's something.
If I had more time I'd look more into it for you. Hope this helps.
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
Swatter does something like this. I would say look at its' code and see how it does it.
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
line wasn't showing up because DBM was blocking it because it matched the pattern it was looking for in its own messages.
You are not logged in. Please
to post a reply or
if you don't already have an account.