View Bug Report
Incorrect hook to AddMessage
Bug #: 6376
File: idChat
Date: 01-09-10 07:06 AM
By: Echo5ive
Status: Unconfirmed
idChat uses an incorrect number of parameters in its hook for AddMessage. A sixth parameter named addAtTop was added in 2.3. Without that parameter, idChat makes the combat log show the oldest rows at the bottom and the newest rows at the top of the combat log if you do not have the combat log tab opened.

A working fix looks like:

Code:
local function AddMessage(frame, text, red, green, blue, id, addAtTop)
	text = tostring(text) or ''

	-- channels
	for k,v in pairs(replaces) do
		text = text:gsub('|h%['..k..'%]|h', '|h'..v..'|h')
	end

	-- 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, addAtTop)
end