Added the implementation for receiving messages to the ChatTask.