logic for listing contacts used for chat.