diff options
author | Joas Schilling <coding@schilljs.com> | 2018-03-12 13:44:24 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2018-03-12 14:22:56 +0300 |
commit | eab0a9059df1eb1972a980b7d757e4bc42ec1184 (patch) | |
tree | 700e7ce037b8aec4eb8d81848173a1d6ed747cc9 /lib/BackgroundJob | |
parent | b88394f26580bab982d9e0407d59c2526dd6b7ab (diff) |
Make the methods public so the callables work
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/BackgroundJob')
-rw-r--r-- | lib/BackgroundJob/RemoveEmptyRooms.php | 2 | ||||
-rw-r--r-- | lib/BackgroundJob/ResetInCallFlags.php | 10 |
2 files changed, 7 insertions, 5 deletions
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); + } } } } |