|
|
@ -72,6 +72,7 @@ our $config = plugin Config => { |
|
|
|
feedbackRecipient => 'admin@example.com', |
|
|
|
feedbackRecipient => 'admin@example.com', |
|
|
|
template => 'default', |
|
|
|
template => 'default', |
|
|
|
inactivityTimeout => 3600, |
|
|
|
inactivityTimeout => 3600, |
|
|
|
|
|
|
|
persistentInactivityTimeout => 0, |
|
|
|
logLevel => 'info', |
|
|
|
logLevel => 'info', |
|
|
|
chromeExtensionId => 'ecicdpoejfllflombfanbhfpgcimjddn', |
|
|
|
chromeExtensionId => 'ecicdpoejfllflombfanbhfpgcimjddn', |
|
|
|
sendmail => '/sbin/sendmail' |
|
|
|
sendmail => '/sbin/sendmail' |
|
|
@ -193,6 +194,13 @@ helper delete_rooms => sub { |
|
|
|
$self->db->do("DELETE FROM participants WHERE id IN (SELECT id FROM rooms WHERE activity_timestamp < $timeout AND persistent='0');"); |
|
|
|
$self->db->do("DELETE FROM participants WHERE id IN (SELECT id FROM rooms WHERE activity_timestamp < $timeout AND persistent='0');"); |
|
|
|
$self->db->do("DELETE FROM rooms WHERE activity_timestamp < $timeout AND persistent='0';"); |
|
|
|
$self->db->do("DELETE FROM rooms WHERE activity_timestamp < $timeout AND persistent='0';"); |
|
|
|
} || return undef; |
|
|
|
} || return undef; |
|
|
|
|
|
|
|
if ($config->{persistentInactivityTimeout} && $config->{persistentInactivityTimeout} > 0){ |
|
|
|
|
|
|
|
eval { |
|
|
|
|
|
|
|
my $timeout = time()-$config->{persistentInactivityTimeout}; |
|
|
|
|
|
|
|
$self->db->do("DELETE FROM participants WHERE id IN (SELECT id FROM rooms WHERE activity_timestamp < $timeout AND persistent='1');"); |
|
|
|
|
|
|
|
$self->db->do("DELETE FROM rooms WHERE activity_timestamp < $timeout AND persistent='1';"); |
|
|
|
|
|
|
|
} || return undef; |
|
|
|
|
|
|
|
} |
|
|
|
return 1; |
|
|
|
return 1; |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|