local handler |
if type(options) == "function" then |
handler = options |
local found = false |
for k,v in pairs(_G) do |
if handler == v then |
local k = k |
handler = function(msg) |
return _G[k](msg) |
if WotLK then |
handler = function(chatFrame, msg) |
return _G[k](msg) |
end |
else |
handler = function(msg) |
return _G[k](msg) |
end |
end |
found = true |
break |
end |
end |
if WotLK and not found then |
local oldHandler = handler |
handler = function(chatFrame, msg) |
oldHandler(msg) |
end |
end |
else |
function handler(msg) |
handlerFunc(self, chat, msg, options) |
if WotLK then |
function handler(chatFrame, msg) |
handlerFunc(self, chat, msg, options) |
end |
else |
function handler(msg) |
handlerFunc(self, chat, msg, options) |
end |
end |
end |
|