|
OK. Sounds to me like your dilemma is determining when a conversation has ended. To solve that, you have to be a bit sneaky as you can't, using just ajax, maintain a persistent connection. If you code the JS so that every X seconds, it pings the server for new messages, then you will be able to update the chat if there are new message and if all members of the chat have not pinged back to see for new messages in that X seconds, then the session could be killed. You could enforce that through mathematical analysis or a cron. To do this you'd have to log the datetime of the ping backs in addition to the chat. So that your logs don't get astronomically large, you may want to setup a table which contains the members and last checked-in time in addition to a table which contains the messages (otherwise you'd be storing every check-in time and that'd be more than you care to store.)
Hope that helps.
__________________
Jeremy Miller
Please login or register to view this content. Registration is FREE
|