addStored method
- WebStoredCall stored, {
- bool withAudio = true,
- bool withVideo = true,
- bool withScreen = false,
override
Transforms the provided WebStoredCall into an OngoingCall and adds it, if not already.
Implementation
@override
Rx<OngoingCall> addStored(
WebStoredCall stored, {
bool withAudio = true,
bool withVideo = true,
bool withScreen = false,
}) {
Log.debug(
'addStored($stored, $withAudio, $withVideo, $withScreen)',
'$runtimeType',
);
Rx<OngoingCall>? ongoing = calls[stored.chatId];
if (ongoing == null) {
ongoing = Rx(
OngoingCall(
stored.chatId,
me,
call: stored.call,
creds: stored.creds,
deviceId: stored.deviceId,
state: stored.state,
withAudio: withAudio,
withVideo: withVideo,
withScreen: withScreen,
mediaSettings: media.value,
),
);
calls[stored.chatId] = ongoing;
} else {
ongoing.value.call.value = ongoing.value.call.value ?? stored.call;
ongoing.value.creds = ongoing.value.creds ?? stored.creds;
ongoing.value.deviceId = ongoing.value.deviceId ?? stored.deviceId;
}
return ongoing;
}