When a user connects to my chat (I'm using the mysql container), they don't see the last max_msg messages. They see a seemingly random number of past messages.
I've done some investigating and have found that in getnewmsg.class.php on lines 60, this code
$from_id = $container->getLastId($recipient)-$c->max_msg;
returns the wrong id.
this may be specific to the mysql container. I've seen that it deletes obsolete messages. Currently, if I SELECT from mysql the last messages, I see that there is a jump in the leaf (id) values.
SELECT leaf FROM phpfreechat ORDER BY leaf DESC;
There are gaps between some messages. Therefore, if as in my case, the last id is 951, and I set max_msg to 100, I may not actually get 100 messages, as some values are missing in the consecutive leaf values.