Table structure and query for messaging between users
For your main question:

You should be able to use a case statement to get just the other person's name:

SELECT m.*, CASE WHEN u2.id = 1
              THEN u1.name
              ELSE u2.name
            END as participant
FROM messages m
JOIN users u1 ON m.sender_id=u1.id
JOIN users u2 ON m.recipient_id=u2.id
WHERE m.id IN (
SELECT MAX(id)
FROM messages
WHERE sender_id = 1 OR recipient_id =1
GROUP BY conversation_id) ORDER BY m.id DESC
;


If the user id from u2 is the ID of the user whose information you're retrieving, then you want the name from u1. Otherwise, you want the name from u2. This should work even if users can send messages to themselves.