diff options
author | Vincent Petry <vincent@nextcloud.com> | 2021-04-14 15:00:48 +0300 |
---|---|---|
committer | Vincent Petry <vincent@nextcloud.com> | 2021-04-14 15:00:48 +0300 |
commit | cc7b2ec3c18272115e99e05ec0517522bbb14442 (patch) | |
tree | 50e1cb0062b0abcb4ccd8ff95a5e8bf2f9d574d5 | |
parent | 428e44dd7311e4c93a385b8e1665601815b92086 (diff) |
Expose session ids as array in participants API
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
-rw-r--r-- | docs/participant.md | 3 | ||||
-rw-r--r-- | lib/Controller/RoomController.php | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/docs/participant.md b/docs/participant.md index 86cfb240c..6352b7e53 100644 --- a/docs/participant.md +++ b/docs/participant.md @@ -35,7 +35,8 @@ `lastPing` | int | * | Timestamp of the last ping of the user (should be used for sorting) `inCall` | int | * | Call flags the user joined with (see [constants list](constants.md#participant-in-call-flag)) `sessionId` | string | * | `'0'` if not connected, otherwise a 512 character long string - `status` | string | * | Optional: Only available with `includeStatus=true`, for users with a set status and when there are less than 100 participants in the conversation + `sessionIds` | array | * | array of session ids, each are 512 character long strings, or empty if no session + `status` | string | * | Optional: Only available with `includeStatus=true`, for users with a set status and when there are less than 100 participants in the conversation `statusIcon` | string | * | Optional: Only available with `includeStatus=true`, for users with a set status and when there are less than 100 participants in the conversation `statusMessage` | string | * | Optional: Only available with `includeStatus=true`, for users with a set status and when there are less than 100 participants in the conversation diff --git a/lib/Controller/RoomController.php b/lib/Controller/RoomController.php index 4cd3e0078..ba9b0abcc 100644 --- a/lib/Controller/RoomController.php +++ b/lib/Controller/RoomController.php @@ -922,6 +922,7 @@ class RoomController extends AEnvironmentAwareController { $results[$attendeeId]['inCall'] |= $session->getInCall(); $results[$attendeeId]['lastPing'] = max($results[$attendeeId]['lastPing'], $session->getLastPing()); $results[$attendeeId]['sessionId'] = $results[$attendeeId]['sessionId'] !== '0' ? $results[$attendeeId]['sessionId'] : $session->getSessionId(); + $results[$attendeeId]['sessionIds'][] = $session->getSessionId(); continue; } @@ -929,6 +930,7 @@ class RoomController extends AEnvironmentAwareController { 'inCall' => Participant::FLAG_DISCONNECTED, 'lastPing' => 0, 'sessionId' => '0', // FIXME empty string or null? + 'sessionIds' => [], 'participantType' => $participant->getAttendee()->getParticipantType(), 'attendeeId' => $attendeeId, 'actorId' => $participant->getAttendee()->getActorId(), @@ -950,6 +952,7 @@ class RoomController extends AEnvironmentAwareController { $result['inCall'] = $participant->getSession()->getInCall(); $result['lastPing'] = $participant->getSession()->getLastPing(); $result['sessionId'] = $participant->getSession()->getSessionId(); + $result['sessionIds'] = [$participant->getSession()->getSessionId()]; } if ($participant->getAttendee()->getActorType() === Attendee::ACTOR_USERS) { |