Thanks a lot..
I was thinking about this solution but i was not sure if is the tag <GM> in the name or a separated tag.
And i hook the funktion ChatFrame_OnEvent function and filter only the CHAT_MSG_WHISPER out if the addon is activated. I check also if its a friend or a guild member how wipsers.
like this
Code:
...
function WisperIgnore_OnLoad()
this:RegisterEvent("VARIABLES_LOADED");
-- hook the chatframe event function
WisperIgnore_Original_ChatFrame_OnEvent = ChatFrame_OnEvent;
ChatFrame_OnEvent = WisperIgnore_ChatFrame_OnEvent;
-- set the slash commands
SlashCmdList["WIGNORE"] = function(msg) WisperIgnore_Cmd(msg); end
SLASH_WIGNORE1 = "/wignore";
end
function WisperIgnore_ChatFrame_OnEvent(event, ...)
if (not WisperIgnore_IsPlayerFriend(arg2) and not WisperIgnore_IsGM(arg2) and not WisperIgnore_IsPlayerGuildMembers(arg2)) then
if (event == "CHAT_MSG_WHISPER" and WisperIgnore_Activ) then
-- return when the response is form a WisperIgnore Addon
if( string.find(arg1, "(OOC: WisperIgnore)" ) ) then
return;
end
WisperIgnore_Print("WisperIgnore: Wisper ignoriert von "..arg2);
WisperIgnore_SendIgnoreMessage(arg2);
return;
else
WisperIgnore_Original_ChatFrame_OnEvent(event, unpack(arg));
end
else
WisperIgnore_Original_ChatFrame_OnEvent(event, unpack(arg));
end
end
...