Looks good, but is way too complicated. It took me some time to understand why we have 4 buttons and why not each of them works with one click for open/collapse.
I would say, keep the one message open and collapse and add a button for open all messages below / close all messages below.
This means, get rid of the second button from the left and use the functionality from the third and forth with one button.
Therefore you need to turn the third button be 90 degrees to the left and when it is pressed, display the third button just as it is, therefore mimicing the functionality of the first button, but with two arrows, therefore indicating "more than one message".