Skip to content

Commit

Permalink
Fix HPB missing event when a session is terminated only
Browse files Browse the repository at this point in the history
Signed-off-by: Joas Schilling <coding@schilljs.com>
  • Loading branch information
nickvergessen committed Mar 8, 2021
1 parent 2183ffc commit 12a48be
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions lib/Signaling/Listener.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,29 @@ protected static function registerExternalSignaling(IEventDispatcher $dispatcher
$sessionIds[] = $session->getSessionId();
}

if ($event->getParticipant()->getSession()) {
$sessionIds[] = $event->getParticipant()->getSession()->getSessionId();
$notifier->roomSessionsRemoved($event->getRoom(), $sessionIds);
}

if (!empty($sessionIds)) {
$notifier->roomSessionsRemoved($event->getRoom(), $sessionIds);
}
});
$dispatcher->addListener(Room::EVENT_AFTER_ROOM_DISCONNECT, static function (ParticipantEvent $event) {
if (self::isUsingInternalSignaling()) {
return;
}

/** @var BackendNotifier $notifier */
$notifier = \OC::$server->query(BackendNotifier::class);

$sessionIds = [];
if ($event->getParticipant()->getSession()) {
$sessionIds[] = $event->getParticipant()->getSession()->getSessionId();
$notifier->roomSessionsRemoved($event->getRoom(), $sessionIds);
}
});

$listener = static function (ModifyParticipantEvent $event) {
if (self::isUsingInternalSignaling()) {
Expand Down

0 comments on commit 12a48be

Please sign in to comment.