-
Notifications
You must be signed in to change notification settings - Fork 448
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Split "room" from "call" when using the standalone signaling server. #492
Conversation
js/webrtc.js
Outdated
@@ -146,6 +143,8 @@ var spreedPeerConnectionTable = []; | |||
}); | |||
|
|||
if (!selfInCall) { | |||
// Own session is no longer in the call, disconnect from all others. | |||
usersChanged([], previousUsersInRoom); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
opsy
lib/Room.php
Outdated
* @param string $sessionId | ||
* @return bool | ||
*/ | ||
public function updateUserSessionId($userId, $sessionId) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check that the user id is not null (guest)
// TODO(fancycode): This will remove the user from other rooms | ||
// he is currently in. Needs to get communicated to the signaling | ||
// server. | ||
$room->updateUserSessionId($userId, $sessionId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why all these changes? The session id does not change when joining/leaving a room
try { | ||
$room = $this->manager->getRoomForParticipantByToken($roomId, $userId); | ||
$room = $this->manager->getRoomByToken($roomId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the only thing that needed a change was to make sure user id is null
instead of empty string
for guests?
Simplified the code: clients through the standalone signaling server are using the Nextcloud session id as with the internal signaling. The ids get "pinged" by the signaling server to make sure sessions stay active. |
Nice benefit, this automatically added support for password-protected rooms with the standalone signaling server 🎉 |
@nickvergessen ptal |
43ba0e8
to
9c0be57
Compare
Rebased and squashed commits - ptal. I will now be looking at writing some tests for the new backend code. |
* @return string | ||
*/ | ||
protected function getInputStream() { | ||
return file_get_contents('php://input'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IRequest::getContent
should do the same
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't IRequest::getContent
already parse the contents if JSON is sent? I need the raw body to verify the checksum.
8600dcb
to
e9121c9
Compare
try { | ||
$room = $this->manager->getRoomForParticipantByToken($roomId, $userId); | ||
$room = $this->manager->getRoomByToken($roomId); | ||
} catch (RoomNotFoundException $e) { | ||
return new JSONResponse([ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is a OCSController now, you should return DataResponse
only.
In your client you can set the accept header or append format=json
to get json:
https://docs.nextcloud.com/server/12/developer_manual/core/externalapi.html#output
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed
925054b
to
b0fee66
Compare
Rebased to master. |
Signed-off-by: Joachim Bauch <bauch@struktur.de>
Clients use the regular joinRoom/-Call API and get a Nextcloud session id. No special handling for sessions from the standalone signaling server are required. The signaling server regularly "pings" active sessions to prevent them from timing out (in case of guest users). Signed-off-by: Joachim Bauch <bauch@struktur.de>
Signed-off-by: Joachim Bauch <bauch@struktur.de>
Signed-off-by: Joachim Bauch <bauch@struktur.de>
Signed-off-by: Joachim Bauch <bauch@struktur.de>
Signed-off-by: Joachim Bauch <bauch@struktur.de>
Signed-off-by: Joachim Bauch <bauch@struktur.de>
Signed-off-by: Joachim Bauch <bauch@struktur.de>
b0fee66
to
e3ef4d2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works now, rebased to hopefully fix tests
Bump @babel/preset-env from 7.5.4 to 7.5.5
This is a follow-up to #459