I'm sorry, but this comment just infuriates me. It's judgmental. I cannot even ever imagine saying this to someone. Ever.
I think it's a comment that has the potential to make people feel even worse about being depressed and hating themselves. It's a damaging thing to say to someone who is suffering.
This blog post explains how I feel about it:
Can you love others if you can?t love yourself?