fixed: #4177 You can no longer send friends who are in your friends list or who you've already invitedto your friends network

This commit is contained in:
Frank Dillon 2008-10-28 17:10:56 +00:00
parent 18585200a7
commit 4dbd7bac1a
4 changed files with 59 additions and 1 deletions

View file

@ -169,6 +169,37 @@ sub isFriend {
#-------------------------------------------------------------------
=head2 isInvited ( userId )
Returns a booelean indicating whether the user has already been invited to the friends network.
=head3 userId
The userId to check against this user.
=cut
sub isInvited {
my $self = shift;
my $session = $self->session;
my $userId = shift;
my ($isInvited) = $session->db->quickArray(q{
select
count(*)
from
friendInvitations
where
inviterId = ?
and friendId = ?
},
[$session->user->userId,$userId]);
return $isInvited;
}
#-------------------------------------------------------------------
=head2 new ( session, user )
Constructor.