Save the chat messages when disconnecting (in addition to when the messages arrive), so that the 'read/unread' flag will get persisted at that time.  This flag doesn't exist yet, but it should be coming soon!