There are many ways to check the profile of the other users:
You can click the chat title of the ‘Direct’ chat to see the user profile of the other user.
You can simply click on the chat avatar or username of the other user displayed along with her or his messages and it will open the user profile of that user
You can check out the participants list of the chat group and click on the desired user to see the user profile. To see the participants list of a chat group, check out the following FAQ: How to see the participants list of a chat group?