A hook that provides access to the Messages instance in the room. It will use the instance belonging to the room in the nearest ChatRoomProvider in the component tree. If a listener is provided, it will subscribe to new messages in the room, and will also set the UseMessagesResponse.getPreviousMessages.