Don't make the 2nd Friend object unless it is needed.
This commit is contained in:
parent
9cdd099d5e
commit
eff2d5295b
1 changed files with 2 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue