The new sessions are computed by substracting the old sessions (those
for which a PeerConnectionWrapper exists) from the sessions currently in
the call. However, when "oldSessions" was used for that it no longer
contained the old sessions, it only contained the sessions which were no
longer in the call. As those sessions are mutually exclusive with the
sessions currently in the call nothing was substracted from
"newSessions", and it ended being the sessions currently in the call
instead.
When the HPB is not used the list of participants in the conversation is
periodically updated every 30 seconds if no other signaling message was
received in the meantime. As the layout for a participant overrides any
previous layout for that participant this periodically reset the layout
of all participants in the call, as they were all treated as new
sessions.
When the HPB is used the list of participants in the conversation is
updated only when something changed. However, similarly to the previous
case, when that happens the layout of all participants in the call is
also reset for the same reason.
To solve that now "oldSessions" is not modified, so it contains the
sessions for which a PeerConnectionWrapper exists, and substracting it
from "newSessions" now gives only the new sessions.
The other usages of "newSessions" besides creating the connection and
setting up the layout, that is, getting the peers in the call and
changing the call status to "In conversation", should be safe if
executed only when there are new sessions rather than when there are
participants in the call but they did not change.
Resolves: #2486
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
The old sessions are used to know which connections need to be ended
because they are no longer in the call. However, if a participant is no
longer in the call but there was no connection yet then there is no
connection that needs to be ended; any existing connection will be added
when looping through the connection list, and if it needs to be stopped
it will be found when substracting the sessions that are currently in
the call.
The old sessions are also used to find the new sessions in the call. Due
to an issue in how that is computed "newSessions" currently store the
sessions in the call rather than only the new sessions (this will be
addressed in a following commit). Nevertheless, in both cases any
session not in the call for which there is no connection either will not
make any difference in the computed "newSessions" (as they are mutually
exclusive, so they will never be removed from "newSessions" when
substracting the old sessions).
Due to all that it is not needed to store sessions not in call as old
sessions / sessions to end.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
This should avoid that the capabilities not available for the server EOL
check in 'ConversationListController#onAttach'.
Missing capabilites can also have an impact on multiple actions, but the
server EOL check is the first one.
Resolves: #2418
Signed-off-by: Tim Krüger <t@timkrueger.me>
When a new participant is found and the layout for that participant is
set up the participant data might have not been fetched yet. If that
happens the user ID can not be got from the data and therefore a guest
avatar would be shown for that participant, even if that participant is
a normal user.
However, the signaling message that is used to find new participants
already includes the user ID, so it is now explicitly given and, if not,
then it is got from the participant data (which is needed when handling
the establishment of a connection, as in that case the event does not
contain the user ID).
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
When setting the participant layout, if the HPB is not used, the user ID
is got from the participant list data fetched when a new participant is
found. However, as the participant layout is setup as soon as a new
participant is found the data may have not been received yet, which
ended in a crash (NullPointerException). Now the access to the
participant object is guarded to prevent that.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>