Implemented unread message count functionality.