From eff2d5295b7e72261523ceeb7fdb09ec22bdb0c0 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Sun, 29 Mar 2009 04:13:33 +0000 Subject: [PATCH] Don't make the 2nd Friend object unless it is needed. --- lib/WebGUI/User.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/WebGUI/User.pm b/lib/WebGUI/User.pm index 7fb6606db..e822544ba 100644 --- a/lib/WebGUI/User.pm +++ b/lib/WebGUI/User.pm @@ -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