get the number of messages in the thread