Hi!
I'm writing a small chat message filter. I'm hooking ChatFrame_MessageEventHandler() like this:
Code:
-- Store original ChatFrame_MessageEventHandler
local ORIG_ChatFrame_MessageEventHandler = ChatFrame_MessageEventHandler
-- Replacement for ChatFrame_MessageEventHandler
function ChatFrame_MessageEventHandler( event, ... )
if event == "CHAT_MSG_MONSTER_SAY" then
-- Ignore annoying NPC messages
if arg2 == "Topper McNabb" or
arg2 == "Thomas Miller" or
arg2 == "William" or
arg2 == "Donna" then
return
end
elseif event == "CHAT_MSG_SAY" or
event == "CHAT_MSG_CHANNEL" or
event == "CHAT_MSG_EMOTE" or
event == "CHAT_MSG_YELL" then
say( "event="..event..", arg1="..arg1..", arg2="..arg2..", arg3="..arg3..", arg4="..arg4..", arg5="..arg5..", arg6="..arg6..", arg7="..arg7..", arg8="..arg8..", arg9="..arg9)
end
return ORIG_ChatFrame_MessageEventHandler( event, ... )
end
...and it turns out I get SEVEN calls to this function per message received in the "LookingForGroup" channel! (don't know about other channels as noone is talking in Desolace
) Seven identical events. The text is output in the chat frame right after the first event is received, and then the 6 others follow.
Is this normal? I can simply process all 7 events like the first one, but it seems like a waste of resources...