Don't make the 2nd Friend object unless it is needed.

This commit is contained in:
Colin Kuskie 2009-03-29 04:13:33 +00:00
parent 9cdd099d5e
commit eff2d5295b

View file

@ -161,9 +161,9 @@ sub acceptsFriendsRequests {
return 0 if($self->userId eq $user->userId); #Can't be your own friend (why would you want to be?)
my $me = WebGUI::Friends->new($session,$self);
my $friend = WebGUI::Friends->new($session,$user);
return 0 if ($me->isFriend($user->userId)); #Already a friend
my $friend = WebGUI::Friends->new($session,$user);
return 0 if ($me->isInvited($user->userId) || $friend->isInvited($self->userId)); #Invitation sent by one or the other
return $self->profileField('ableToBeFriend'); #Return profile setting