-
Notifications
You must be signed in to change notification settings - Fork 509
Add support for federated calls #12668
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
Conversation
d0c9b8e to
6aff0e1
Compare
7a14f53 to
53ca371
Compare
| use OCA\Talk\Room; | ||
|
|
||
| abstract class ARoomModifiedEvent extends ARoomEvent { | ||
| public const PROPERTY_ACTIVE_SINCE = 'activeSince'; |
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.
This is handled by other logic when inCall is toggled to or from 0
Now it would send 2 remote requests? Maybe it would be useful to create a special case like with the lobby (which has the lobbytimer in addition)
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.
Now the ActiveSinceModifiedEvent includes the call flags too. If only the call flags are modified, without touching "active since", a RoomModifiedEvent for the in_call property is triggered instead.
| $this->roomService->resetActiveSince($room); | ||
| } else { | ||
| $activeSince = \DateTime::createFromFormat('U', $notification['newValue']); | ||
| $this->roomService->setActiveSince($room, $activeSince, $room->getCallFlag(), false); |
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.
this will not work, depending on the order the requests arrive or when they arrive in parallel
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.
But doesn't all properties have the same problem if they are quickly modified?
Or do you mean regarding sending a request for "active since" and then another one for "in call" both for the same action of modifying the "in call" status? In that case now there is a single request when a call is started which provides the value of both "active since" and "in call".
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.
Or do you mean regarding sending a request for "active since" and then another one for "in call" both for the same action of modifying the "in call" status?
yes
But doesn't all properties have the same problem if they are quickly modified?
well the case of activesince+callflag is the only one apart from lobby that touches multiple at the same time and they need to come in the same event request
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.
As described above now the ActiveSinceModifiedEvent includes bot the active since and the call flags.
I noticed a corner case behaviour, though: if some notification is missed for some reason and a newer notification arrives, when the old notification is retried it could wipe the newer value. But that is unrelated to the changes here and more a general problem, so I will open an issue about that.
| if ($attendee->getActorType() === Attendee::ACTOR_USERS) { | ||
| if ($attendee->getActorType() === Attendee::ACTOR_USERS | ||
| || $attendee->getActorType() === Attendee::ACTOR_FEDERATED_USERS) { | ||
| $data['userId'] = $attendee->getActorId(); |
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.
This could be problematic as there could be a conflict?
Is it required by the HPB, or could it be either a new attribute $data['cloudId'] or dedicated actor type+id fields?
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 assumed that the actorId of a federated user always includes the @remote part (based on what I saw in my test instances) 🤔
If they do not then 7056338 will need to be fixed, as that one affects how receives the signaling messages (the change here is only about the data sent and probably a different field could be used if needed).
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 assumed that the actorId of a federated user always includes the @Remote part (based on what I saw in my test instances)
They do, but it can still conflict. UserA@ServerA could also be a valid email address that they received as user ID on ServerB when being invited via the guest app.
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.
OK, something for a follow up then.
| if ($attendee->getActorType() === Attendee::ACTOR_USERS) { | ||
| if ($attendee->getActorType() === Attendee::ACTOR_USERS | ||
| || $attendee->getActorType() === Attendee::ACTOR_FEDERATED_USERS) { | ||
| $data['userId'] = $attendee->getActorId(); |
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.
same problem here
53ca371 to
37431a9
Compare
| $this->timeFactory->getDateTime(), | ||
| $participant->getSession() ? $participant->getSession()->getInCall() : Participant::FLAG_DISCONNECTED, | ||
| $participant->getAttendee()->getActorType() !== Attendee::ACTOR_USERS | ||
| $participant->getSession() ? $participant->getSession()->getInCall() : Participant::FLAG_DISCONNECTED |
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.
| $participant->getSession() ? $participant->getSession()->getInCall() : Participant::FLAG_DISCONNECTED | |
| $participant->getSession() ? $participant->getSession()->getInCall() : Participant::FLAG_DISCONNECTED, | |
| $participant->getAttendee()->getActorType() === Attendee::ACTOR_GUESTS |
To keep writing the data for now, while we fix reading it
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.
Guests are counted from the attendees instead of from the active_guests column for several years already, according to the PR:
Make the call summary reuse the attendee table also for guests, so we don't have "and 132 guests" when a guest rejoins with a weak internet connection.
Due to that and to either avoid propagating it for consistency, or not propagating it which would work for now if the field is used only for the call summary but could cause unexpected inconsistencies in the future if it ends used for something else, I kept it removed and did not change it.
And if it needs to be introduced back later... we can always do it anyway :-)
| 'avatar' => '', | ||
| 'remote_server' => '', | ||
| 'remote_token' => '', | ||
| 'active_guests' => 0, |
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.
restore
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.
Kept removed as explained above.
7850718 to
e6bca6e
Compare
Signed-off-by: Daniel Calviño Sánchez <[email protected]>
fc6ed23 to
d4d9809
Compare
Signed-off-by: Joas Schilling <[email protected]>
Signed-off-by: Daniel Calviño Sánchez <[email protected]>
Signed-off-by: Daniel Calviño Sánchez <[email protected]>
"In call" status is set from two different properties, "active since" and "call flag". Call flags can be modified independently, but "active since" is always linked to setting call flags, so the event needs to include both properties. Signed-off-by: Daniel Calviño Sánchez <[email protected]>
In federated conversations the recording consent is got directly from the host room (through the propagated property), no matter the global configuration for recording consent in the federated instance. Signed-off-by: Daniel Calviño Sánchez <[email protected]>
The federated users are now included in the "inCall" and "participants" notfications sent from the Nextcloud server to the signaling server, so their data is also included in the "participants->update" events sent from the signaling server to the clients. Otherwise the clients would not be notified when the properties of a federated user change, not even for their own participant. Note that the "participants->update" is also received by federated clients when the default permissions of the room change, even if the default permissions themselves are not propagated to the federated room, as the change in the default permissions also cause a change in the participant permissions. Signed-off-by: Daniel Calviño Sánchez <[email protected]>
d4d9809 to
1b65c8b
Compare
As federated users can now join calls the setting to show the media settings or not before joining a call is also shown for federated conversations. Signed-off-by: Daniel Calviño Sánchez <[email protected]>
Signed-off-by: Daniel Calviño Sánchez <[email protected]>
Signed-off-by: Daniel Calviño Sánchez <[email protected]>
This should be properly fixed... but I have not found a way to do it :-( Signed-off-by: Daniel Calviño Sánchez <[email protected]>
1b65c8b to
13f092a
Compare
Antreesy
left a comment
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.
See nothing breaking here, but mostly Yolo-ing
Already addressed or will be in follow-ups
Requires #12604
Permissions
The default permissions of the conversation are not propagated to the federated conversation. However, that would be relevant only for moderators (and currently federated users can not be moderator) when showing or modifying the current default permissions. The actual permissions used by participants, although affected by the default permissions, are got directly from the participant data.
Moreover, even if the default permissions are not propagated, when the permissions of a participant are modified in any way the remote Nextcloud server triggers a
participants->updatesignaling message that now also includes federated users. So, to sum up, changes in participant permissions for federated users can be handled just like for regular users.TODO: