local function AddMessage(frame, text, red, green, blue, id) |
text = tostring(text) or '' |
|
-- channels |
for k,v in pairs(replaces) do |
text = text:gsub('|h%['..k..'%]|h', '|h'..v..'|h') |
end |
|
text = text:gsub('(|Hplayer.-|h)%[(.-)%].-:', '%1%2|h:') |
-- players |
text = text:gsub('(|Hplayer.-|h)%[(.-)%]|h', '%1%2|h') |
|
-- normal messages |
text = text:gsub(' says:', ':') |
|
-- whispers |
text = text:gsub(' whispers:', ' <') |
text = text:gsub('To (|Hplayer.+|h):', '%1 >') |
|
-- achievements |
text = text:gsub('(|Hplayer.+|h) has earned the achievement (.+)!', '%1 ! %2') |
|
-- timestamp |
text = '|cff999999' .. date('%H%M') .. '|r ' .. text |
|
return hooks[frame](frame, text, red, green, blue, id) |