mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Add more data to jitsi calls
This commit is contained in:
parent
ccd4e4261b
commit
d53dcf1ea2
@ -786,6 +786,28 @@ public final class PresentationCallImpl: PresentationCall {
|
||||
strongSelf.audioLevelPromise.set(level)
|
||||
}
|
||||
})
|
||||
|
||||
let localIsConnected = conferenceCall.state
|
||||
|> map { state -> Bool in
|
||||
switch state.networkState {
|
||||
case .connected:
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
|> distinctUntilChanged
|
||||
|
||||
let bothLocalAndRemoteConnected = combineLatest(queue: .mainQueue(),
|
||||
localIsConnected,
|
||||
remoteIsConnectedAggregated
|
||||
)
|
||||
|> map { localIsConnected, remoteIsConnectedAggregated -> Bool in
|
||||
return localIsConnected && remoteIsConnectedAggregated
|
||||
}
|
||||
|> distinctUntilChanged
|
||||
|
||||
conferenceCall.internal_isRemoteConnected.set(bothLocalAndRemoteConnected)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -871,6 +871,9 @@ public final class PresentationGroupCallImpl: PresentationGroupCall {
|
||||
private let conferenceFromCallId: CallId?
|
||||
private let isConference: Bool
|
||||
|
||||
var internal_isRemoteConnected = Promise<Bool>()
|
||||
private var internal_isRemoteConnectedDisposable: Disposable?
|
||||
|
||||
public var onMutedSpeechActivityDetected: ((Bool) -> Void)?
|
||||
|
||||
init(
|
||||
@ -1228,6 +1231,8 @@ public final class PresentationGroupCallImpl: PresentationGroupCall {
|
||||
self.screencastFramesDisposable?.dispose()
|
||||
self.screencastAudioDataDisposable?.dispose()
|
||||
self.screencastStateDisposable?.dispose()
|
||||
|
||||
self.internal_isRemoteConnectedDisposable?.dispose()
|
||||
}
|
||||
|
||||
private func switchToTemporaryParticipantsContext(sourceContext: GroupCallParticipantsContext?, oldMyPeerId: PeerId) {
|
||||
@ -1783,6 +1788,15 @@ public final class PresentationGroupCallImpl: PresentationGroupCall {
|
||||
})
|
||||
|
||||
self.signalBarsPromise.set(callContext.signalBars)
|
||||
|
||||
self.internal_isRemoteConnectedDisposable = (self.internal_isRemoteConnected.get()
|
||||
|> distinctUntilChanged
|
||||
|> deliverOnMainQueue).startStrict(next: { [weak callContext] isRemoteConnected in
|
||||
guard let callContext else {
|
||||
return
|
||||
}
|
||||
callContext.addRemoteConnectedEvent(isRemoteConntected: isRemoteConnected)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1035,6 +1035,10 @@ public final class OngoingGroupCallContext {
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
func addRemoteConnectedEvent(isRemoteConntected: Bool) {
|
||||
self.context.addRemoteConnectedEvent(isRemoteConntected)
|
||||
}
|
||||
}
|
||||
|
||||
private let queue = Queue()
|
||||
@ -1250,4 +1254,10 @@ public final class OngoingGroupCallContext {
|
||||
impl.setTone(tone: tone)
|
||||
}
|
||||
}
|
||||
|
||||
public func addRemoteConnectedEvent(isRemoteConntected: Bool) {
|
||||
self.impl.with { impl in
|
||||
impl.addRemoteConnectedEvent(isRemoteConntected: isRemoteConntected)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -453,6 +453,8 @@ isConference:(bool)isConference;
|
||||
|
||||
- (void)getStats:(void (^ _Nonnull)(OngoingGroupCallStats * _Nonnull))completion;
|
||||
|
||||
- (void)addRemoteConnectedEvent:(bool)isRemoteConnected;
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
||||
|
@ -2323,6 +2323,12 @@ isConference:(bool)isConference {
|
||||
}
|
||||
}
|
||||
|
||||
- (void)addRemoteConnectedEvent:(bool)isRemoteConnected {
|
||||
if (_instance) {
|
||||
_instance->internal_addCustomNetworkEvent(isRemoteConnected);
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation OngoingGroupCallMediaChannelDescription
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit b872bbfe2ad48d07d8388905bb0bfd592e3068b1
|
||||
Subproject commit a0706c7557f4b5391bc2465cc23783945980ce77
|
Loading…
x
Reference in New Issue
Block a user