Originally Posted by Gryns
It works for some, but not for other. For instance, it filters the realm suffix from the /hi emote but it doesn't grab the /wave emote for instance. i.e "Semlar greets Gryns with a hearty hello" but, "Semlar waves at "Gryns-Aggramar" Any idea why that is?
|
It's not looking for names with quotes around them, the %f[] at the start and end of the pattern contains a character class representing a transition from any of the characters inside of the brackets to the characters in the name itself.
%s matches any whitespace and %z essentially matches "nothing", which allows it to match the name if it's at the start or end of the message.
So, since "Gryns-Aggramar" is surrounded by quotes and not spaces, the pattern fails.
Add double-quotes to the frontier pattern to allow them to match.
Lua Code:
ChatFrame_AddMessageEventFilter('CHAT_MSG_TEXT_EMOTES', function(self, event, msg, ...)
return false, (msg:gsub('%f[^%z%s"]([^\1-\64\91-\96\123-191]+)%-%u%l%a+%f[%z%s"]', '%1')), ...
end)