Browse Source
Reset the in-call flags when the lobby kicks in
Signed-off-by: Joas Schilling <coding@schilljs.com>
pull/2260/head
Joas Schilling
6 years ago
No known key found for this signature in database
GPG Key ID: 7076EA9751AACDDA
1 changed files with
32 additions and
0 deletions
-
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]]] |
|
|
|
|