Add more coverage tests for methods added to User.pm
for Friends. Fix a bug in the isOnline method, which was looking sessions exactly 600 seconds old.
This commit is contained in:
parent
c860bfdd10
commit
b8a4033036
2 changed files with 75 additions and 6 deletions
|
|
@ -421,7 +421,7 @@ Returns a boolean indicating whether this user is logged in and actively viewing
|
|||
|
||||
sub isOnline {
|
||||
my $self = shift;
|
||||
my ($flag) = $self->session->db->quickArray('select count(*) from userSession where userId=? and lastPageView=?',
|
||||
my ($flag) = $self->session->db->quickArray('select count(*) from userSession where userId=? and lastPageView>=?',
|
||||
[$self->userId, time() - 60*10]);
|
||||
return $flag;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue