mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Show voice chat participants count in subtitle
This commit is contained in:
parent
2c4cb11524
commit
56a710b729
@ -73,7 +73,7 @@ public final class PresentationGroupCallImpl: PresentationGroupCall {
|
|||||||
private class SpeakingParticipantsContext {
|
private class SpeakingParticipantsContext {
|
||||||
private let speakingLevelThreshold: Float = 0.15
|
private let speakingLevelThreshold: Float = 0.15
|
||||||
private let cutoffTimeout: Int32 = 1
|
private let cutoffTimeout: Int32 = 1
|
||||||
private let silentTimeout: Int32 = 2
|
private let silentTimeout: Int32 = 3
|
||||||
|
|
||||||
struct Participant {
|
struct Participant {
|
||||||
let timestamp: Int32
|
let timestamp: Int32
|
||||||
|
@ -481,10 +481,16 @@ public final class VoiceChatController: ViewController {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if let groupMembers = strongSelf.currentGroupMembers {
|
if let groupMembers = strongSelf.currentGroupMembers {
|
||||||
strongSelf.updateMembers(muteState: strongSelf.callState?.muteState, groupMembers: groupMembers, callMembers: callMembers.participants, speakingPeers: callMembers.speakingParticipants ?? Set(), invitedPeers: strongSelf.currentInvitedPeers ?? Set())
|
strongSelf.updateMembers(muteState: strongSelf.callState?.muteState, groupMembers: groupMembers, callMembers: callMembers.participants, speakingPeers: callMembers.speakingParticipants, invitedPeers: strongSelf.currentInvitedPeers ?? Set())
|
||||||
} else {
|
} else {
|
||||||
strongSelf.currentCallMembers = callMembers.participants
|
strongSelf.currentCallMembers = callMembers.participants
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//TODO:localize
|
||||||
|
let subtitle = strongSelf.presentationData.strings.Conversation_StatusMembers(Int32(callMembers.totalCount))
|
||||||
|
if let titleView = strongSelf.controller?.navigationItem.titleView as? VoiceChatControllerTitleView {
|
||||||
|
titleView.set(title: "Voice Chat", subtitle: subtitle)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
self.invitedPeersDisposable = (self.call.invitedPeers
|
self.invitedPeersDisposable = (self.call.invitedPeers
|
||||||
@ -516,21 +522,6 @@ public final class VoiceChatController: ViewController {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
guard let peer = view.peers[view.peerId] else {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
//TODO:localize
|
|
||||||
var subtitle = "group"
|
|
||||||
if let cachedData = view.cachedData as? CachedChannelData {
|
|
||||||
if let memberCount = cachedData.participantsSummary.memberCount {
|
|
||||||
subtitle = strongSelf.presentationData.strings.Conversation_StatusMembers(memberCount)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
let titleView = VoiceChatControllerTitleView(theme: strongSelf.presentationData.theme)
|
|
||||||
titleView.set(title: "Voice Chat", subtitle: subtitle)
|
|
||||||
strongSelf.controller?.navigationItem.titleView = titleView
|
|
||||||
|
|
||||||
if !strongSelf.didSetDataReady {
|
if !strongSelf.didSetDataReady {
|
||||||
strongSelf.didSetDataReady = true
|
strongSelf.didSetDataReady = true
|
||||||
strongSelf.controller?.dataReady.set(true)
|
strongSelf.controller?.dataReady.set(true)
|
||||||
@ -674,6 +665,10 @@ public final class VoiceChatController: ViewController {
|
|||||||
override func didLoad() {
|
override func didLoad() {
|
||||||
super.didLoad()
|
super.didLoad()
|
||||||
|
|
||||||
|
let titleView = VoiceChatControllerTitleView(theme: self.presentationData.theme)
|
||||||
|
titleView.set(title: "Voice Chat", subtitle: "connecting")
|
||||||
|
self.controller?.navigationItem.titleView = titleView
|
||||||
|
|
||||||
let longTapRecognizer = UILongPressGestureRecognizer(target: self, action: #selector(self.actionButtonPressGesture(_:)))
|
let longTapRecognizer = UILongPressGestureRecognizer(target: self, action: #selector(self.actionButtonPressGesture(_:)))
|
||||||
longTapRecognizer.minimumPressDuration = 0.001
|
longTapRecognizer.minimumPressDuration = 0.001
|
||||||
self.actionButton.view.addGestureRecognizer(longTapRecognizer)
|
self.actionButton.view.addGestureRecognizer(longTapRecognizer)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user