This should work:
Code:
local DESTINATION = UIErrorsFrame
local ONLINE = ERR_FRIEND_ONLINE_SS:gsub("%%s", "(.+)"):gsub("[%[%]]", "%%%1")
local OFFLINE = ERR_FRIEND_OFFLINE_S:gsub("%%s", "(.+)")
local f = CreateFrame("Frame")
f:RegisterEvent("CHAT_MSG_SYSTEM")
f:SetScript("OnEvent", function(self, event, text)
if text:match(ONLINE) then
DESTINATION:AddMessage(text:gsub("%[(.-)%]", "%1"), 0.3, 1, 0.3)
elseif text:match(OFFLINE) then
DESTINATION:AddMessage(text, .6, .6, .6)
end
end)
Change the first line if you want to send the messages to some other chat frame, eg. ChatFrame3
Use
Vlad's addon creator tool to turn the code into an addon.