diff --git a/lib/BackgroundJob/RemoveEmptyRooms.php b/lib/BackgroundJob/RemoveEmptyRooms.php index 246762b39..203697488 100644 --- a/lib/BackgroundJob/RemoveEmptyRooms.php +++ b/lib/BackgroundJob/RemoveEmptyRooms.php @@ -60,7 +60,7 @@ class RemoveEmptyRooms extends TimedJob { } } - protected function callback(Room $room) { + public function callback(Room $room) { if ($room->getType() === Room::ONE_TO_ONE_CALL && $room->getNumberOfParticipants(false) <= 1) { $room->deleteRoom(); $this->numDeletedRooms++; diff --git a/lib/BackgroundJob/ResetInCallFlags.php b/lib/BackgroundJob/ResetInCallFlags.php index dbff79a3a..29006981d 100644 --- a/lib/BackgroundJob/ResetInCallFlags.php +++ b/lib/BackgroundJob/ResetInCallFlags.php @@ -26,7 +26,6 @@ use OCA\Spreed\Exceptions\ParticipantNotFoundException; use OCA\Spreed\Manager; use OCA\Spreed\Room; use OCP\AppFramework\Utility\ITimeFactory; -use OCP\ILogger; /** * Class ResetInCallFlags @@ -54,7 +53,7 @@ class ResetInCallFlags extends TimedJob { $this->manager->forAllRooms([$this, 'callback']); } - protected function callback(Room $room) { + public function callback(Room $room) { if (!$room->hasSessionsInCall()) { return; } @@ -67,8 +66,11 @@ class ResetInCallFlags extends TimedJob { continue; } - if ($participant->isInCall() && $participant->getLastPing() < $this->timeout) { - $room->changeInCall($session, false); + if ($participant->getLastPing() < $this->timeout) { + // TODO reset session too + if ($participant->isInCall()) { + $room->changeInCall($session, false); + } } } }