How to determine the message status (read/unread). Chat is realized with the XMPP protocol.
I think you need to use the Displayed Chat Marker, per http://xmpp.org/extensions/xep-0333.html