TODO:
check id type --> see TODO "currentTimeMillies fails as id because later on in the model it's not Long but Int!!!!" in OfflineFirstChatRepository.kt
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
(as datasources should be only used in repositories)
use coroutines instead RxJava for api calls triggered by MessageInputViewModel
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
The speaking state is still sent only through data channels, as it is
not currently handled by other clients when sent through signaling
messages.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Note that this implicitly send the current state to remote participants
when the local participant joins, as in that case all the remote
participants already in the call join from the point of view of the
local participant
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
This is not possible when Janus is used, as Janus only allows
broadcasting data channel messages to all the subscribers of the
publisher connection.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
The LocalStateBroadcaster observes changes in the
LocalCallParticipantModel and notifies other participants in the call as
needed. Although it is created right before joining the call there is a
slim chance of the state changing before the local participant is
actually in the call, but even in that case other participants would not
be notified about the state due to the MessageSender depending on the
list of call participants / peer connections passed to it, which should
not be initialized before the local participant is actually in the call.
There is, however, a race condition that could cause participants to not
be added to the participant list if they join at the same time as the
local participant and a signaling message listing them but not the local
participant as in the call is received once the CallParticipantList was
created, but that is unrelated to the broadcaster and will be fixed
in another commit.
Currently only changes in the audio, speaking and video state are
notified, although in the future it should also notify about the nick,
the raised hand or any other state (but not one-time events, like
reactions). The notifications right now are sent only through data
channels, but at a later point they will be sent also through signaling
messages as needed.
Similarly, although right now it only notifies of changes in the state
it will also take care of notifying other participants about the current
state when they join the call (or the local participant joins).
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
This is the counterpart of CallParticipantModel for the local
participant. For now it just stores whether audio and video are enabled
or not, and whether the local participant is speaking or not, but it
will be eventually extended with further properties.
It is also expected that the views, like the button with the microphone
state, will update themselves based on the model. Similarly the model
should be moved from the CallActivity to a class similar to
CallParticipant but for the local participant. In any case, all that is
something for the future; the immediate use of the model will be to know
when the local state changes to notify other participants.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>