prepare a function to get all messages for a conversation