Fix ping_room timestamp updates

master
Daniel Berteaud 10 years ago
parent 3a280ab370
commit effaf249ad
  1. 8
      vroom.pl

@ -641,17 +641,17 @@ helper ping_room => sub {
return undef unless ($data); return undef unless ($data);
my $sth = eval { my $sth = eval {
$self->db->prepare('UPDATE `rooms` $self->db->prepare('UPDATE `rooms`
SET `last_activity`=? SET `last_activity`=CONVERT_TZ(NOW(), @@session.time_zone, \'+00:00\')
WHERE `id`=?'); WHERE `id`=?');
} || return undef; } || return undef;
$sth->execute(time(),$data->{id}) || return undef; $sth->execute($data->{id}) || return undef;
$sth = eval { $sth = eval {
$self->db->prepare('UPDATE `room_participants` $self->db->prepare('UPDATE `room_participants`
SET `last_activity`=? SET `last_activity`=CONVERT_TZ(NOW(), @@session.time_zone, \'+00:00\')
WHERE `id`=? WHERE `id`=?
AND `participant`=?'); AND `participant`=?');
} || return undef; } || return undef;
$sth->execute(time(),$data->{id},$self->session('name')) || return undef; $sth->execute($data->{id},$self->session('name')) || return undef;
$self->app->log->debug($self->session('name') . " pinged the room $name"); $self->app->log->debug($self->session('name') . " pinged the room $name");
return 1; return 1;
}; };

Loading…
Cancel
Save