зеркало из https://github.com/nextcloud/spreed.git
Merge pull request #2967 from nextcloud/bugfix/2966/error-when-logout-while-in-a-call
Fix leaving a call on logout
This commit is contained in:
Коммит
0bb153fca8
|
@ -103,12 +103,13 @@ class Listener {
|
|||
/** @var IUser $user */
|
||||
$user = $this->userSession->getUser();
|
||||
|
||||
/** @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($sessionId, Participant::FLAG_DISCONNECTED);
|
||||
$room->changeInCall($participant, Participant::FLAG_DISCONNECTED);
|
||||
}
|
||||
$room->leaveRoom($user->getUID(), $sessionId);
|
||||
}
|
||||
|
|
|
@ -34,6 +34,9 @@ class TalkSession {
|
|||
$this->session = $session;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
public function getAllActiveSessions(): array {
|
||||
$sessions = $this->getValues('spreed-session');
|
||||
return array_values($sessions);
|
||||
|
|
Загрузка…
Ссылка в новой задаче