rewrote the function that determines message indent levels for thread sort.