HackThis/hackthis.co.uk — pull request #145 by DJDavid98 (2014-07-25 00:27:50+00:00)
Title: Fix "Add friend" button visible to profile owner

I just found out that apparently you can add yourself as a friend, and since I think that's a bug, I've taken a step towards fixing it.

The reason why I didn't add the additional condition to line 64 instead is that it'd cause people who have already found this bug and added themselves as a friend to be unable to undo it. For this reason, the button is only hidden when either
1. A user haven't yet added themselves as a friend
2. or they removed themselves as a friend and are no longer friends

A server side check should also be added in order to prevent this, but since I don't understand the logic behind the profile class' code, I wasn't able to do it.