Friedrich Nietzsche said this quote

Rejoicing in our joy, not suffering over our suffering, makes someone a friend.