diff --git a/pkg/models/friend.go b/pkg/models/friend.go index 01d6373..b2d890b 100644 --- a/pkg/models/friend.go +++ b/pkg/models/friend.go @@ -36,6 +36,14 @@ func AddFriend(sourceUserID, targetUserID uint64) error { targetUserID, sourceUserID, ).First(&rev).Error + // If we have previously Ignored the friend request, we can not Accept it but only Reject it. + if reverse == nil && rev.Ignored { + return errors.New( + "you have previously ignored a friend request from this person and can not accept it now - " + + "please go to your Friends page, Ignored tab, and remove the ignored friend request there and try again", + ) + } + // If the reverse exists (requested us) but not the forward, this completes the friendship. if reverse == nil && forward != nil { // Approve the reverse. diff --git a/web/templates/friend/friends.html b/web/templates/friend/friends.html index 99dada7..c7590ff 100644 --- a/web/templates/friend/friends.html +++ b/web/templates/friend/friends.html @@ -115,7 +115,14 @@ - {{if or $Root.IsRequests $Root.IsIgnored}} + {{if $Root.IsIgnored}} + + {{else if $Root.IsRequests}} {{else}}