Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/spreed.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2020-06-30 15:45:21 +0300
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2020-07-02 13:41:49 +0300
commit051d83ccb8c28f2a429bb94dcd9cc209de8d048d (patch)
treeb1a45128102dbc8f34cccc5786dc34983b0ad5bc /lib
parent83a9fdcc78bf18008726ff6cf54ee7f7714e6458 (diff)
Catch exceptions during logout cleanup
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/Listener.php16
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/Listener.php b/lib/Listener.php
index c4235d945..d9ba0e3e7 100644
--- a/lib/Listener.php
+++ b/lib/Listener.php
@@ -23,6 +23,8 @@ declare(strict_types=1);
namespace OCA\Talk;
+use OCA\Talk\Exceptions\ParticipantNotFoundException;
+use OCA\Talk\Exceptions\RoomNotFoundException;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\IUser;
use OCP\IUserManager;
@@ -92,12 +94,16 @@ class Listener {
/** @var string[] $sessionIds */
$sessionIds = $this->talkSession->getAllActiveSessions();
foreach ($sessionIds as $sessionId) {
- $room = $this->manager->getRoomForSession($user->getUID(), $sessionId);
- $participant = $room->getParticipant($user->getUID());
- if ($participant->getInCallFlags() !== Participant::FLAG_DISCONNECTED) {
- $room->changeInCall($participant, Participant::FLAG_DISCONNECTED);
+ try {
+ $room = $this->manager->getRoomForSession($user->getUID(), $sessionId);
+ $participant = $room->getParticipant($user->getUID());
+ if ($participant->getInCallFlags() !== Participant::FLAG_DISCONNECTED) {
+ $room->changeInCall($participant, Participant::FLAG_DISCONNECTED);
+ }
+ $room->leaveRoom($user->getUID(), $sessionId);
+ } catch (RoomNotFoundException $e) {
+ } catch (ParticipantNotFoundException $e) {
}
- $room->leaveRoom($user->getUID(), $sessionId);
}
}
}