зеркало из https://github.com/nextcloud/spreed.git
Reset the in-call flags when the lobby kicks in
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Родитель
91e866b33d
Коммит
1d5cf96356
32
lib/Room.php
32
lib/Room.php
|
@ -620,6 +620,17 @@ class Room {
|
|||
|
||||
$this->dispatcher->dispatch(self::EVENT_AFTER_LOBBY_STATE_SET, $event);
|
||||
|
||||
if ($newState === Webinary::LOBBY_NON_MODERATORS) {
|
||||
$participants = $this->getParticipantsInCall();
|
||||
foreach ($participants as $participant) {
|
||||
if ($participant->hasModeratorPermissions()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$this->changeInCall($participant, Participant::FLAG_DISCONNECTED);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -984,6 +995,27 @@ class Room {
|
|||
return $participants;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Participant[]
|
||||
*/
|
||||
public function getParticipantsInCall(): array {
|
||||
$query = $this->db->getQueryBuilder();
|
||||
$query->select('*')
|
||||
->from('talk_participants')
|
||||
->where($query->expr()->eq('room_id', $query->createNamedParameter($this->getId(), IQueryBuilder::PARAM_INT)))
|
||||
->andWhere($query->expr()->neq('in_call', $query->createNamedParameter(Participant::FLAG_DISCONNECTED)));
|
||||
|
||||
$result = $query->execute();
|
||||
|
||||
$participants = [];
|
||||
while ($row = $result->fetch()) {
|
||||
$participants[] = $this->manager->createParticipantObject($this, $row);
|
||||
}
|
||||
$result->closeCursor();
|
||||
|
||||
return $participants;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $lastPing When the last ping is older than the given timestamp, the user is ignored
|
||||
* @return array[] Array of users with [users => [userId => [lastPing, sessionId]], guests => [[lastPing, sessionId]]]
|
||||
|
|
Загрузка…
Ссылка в новой задаче