mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Conference
This commit is contained in:
parent
22b4c30774
commit
dcde323740
@ -99,6 +99,12 @@ public enum ContactListPeer: Equatable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public final class ContactSelectionControllerParams {
|
public final class ContactSelectionControllerParams {
|
||||||
|
public enum MultipleSelectionMode {
|
||||||
|
case disabled
|
||||||
|
case possible
|
||||||
|
case always
|
||||||
|
}
|
||||||
|
|
||||||
public let context: AccountContext
|
public let context: AccountContext
|
||||||
public let updatedPresentationData: (initial: PresentationData, signal: Signal<PresentationData, NoError>)?
|
public let updatedPresentationData: (initial: PresentationData, signal: Signal<PresentationData, NoError>)?
|
||||||
public let mode: ContactSelectionControllerMode
|
public let mode: ContactSelectionControllerMode
|
||||||
@ -107,7 +113,7 @@ public final class ContactSelectionControllerParams {
|
|||||||
public let options: Signal<[ContactListAdditionalOption], NoError>
|
public let options: Signal<[ContactListAdditionalOption], NoError>
|
||||||
public let displayDeviceContacts: Bool
|
public let displayDeviceContacts: Bool
|
||||||
public let displayCallIcons: Bool
|
public let displayCallIcons: Bool
|
||||||
public let multipleSelection: Bool
|
public let multipleSelection: MultipleSelectionMode
|
||||||
public let requirePhoneNumbers: Bool
|
public let requirePhoneNumbers: Bool
|
||||||
public let allowChannelsInSearch: Bool
|
public let allowChannelsInSearch: Bool
|
||||||
public let confirmation: (ContactListPeer) -> Signal<Bool, NoError>
|
public let confirmation: (ContactListPeer) -> Signal<Bool, NoError>
|
||||||
@ -124,7 +130,7 @@ public final class ContactSelectionControllerParams {
|
|||||||
options: Signal<[ContactListAdditionalOption], NoError> = .single([]),
|
options: Signal<[ContactListAdditionalOption], NoError> = .single([]),
|
||||||
displayDeviceContacts: Bool = false,
|
displayDeviceContacts: Bool = false,
|
||||||
displayCallIcons: Bool = false,
|
displayCallIcons: Bool = false,
|
||||||
multipleSelection: Bool = false,
|
multipleSelection: MultipleSelectionMode = .disabled,
|
||||||
requirePhoneNumbers: Bool = false,
|
requirePhoneNumbers: Bool = false,
|
||||||
allowChannelsInSearch: Bool = false,
|
allowChannelsInSearch: Bool = false,
|
||||||
confirmation: @escaping (ContactListPeer) -> Signal<Bool, NoError> = { _ in .single(true) },
|
confirmation: @escaping (ContactListPeer) -> Signal<Bool, NoError> = { _ in .single(true) },
|
||||||
|
@ -525,7 +525,7 @@ final class CallListControllerNode: ASDisplayNode {
|
|||||||
|> mapToQueue { (updateAndType, state, groupCalls, showCallsTab, currentGroupCallPeerId) -> Signal<CallListNodeListViewTransition, NoError> in
|
|> mapToQueue { (updateAndType, state, groupCalls, showCallsTab, currentGroupCallPeerId) -> Signal<CallListNodeListViewTransition, NoError> in
|
||||||
let (update, type) = updateAndType
|
let (update, type) = updateAndType
|
||||||
|
|
||||||
let processedView = CallListNodeView(originalView: update.view, filteredEntries: callListNodeEntriesForView(view: update.view, displayOpenNewCall: mode == .tab, groupCalls: groupCalls, state: state, showSettings: showSettings, showCallsTab: showCallsTab, isRecentCalls: type == .all, currentGroupCallPeerId: currentGroupCallPeerId), presentationData: state.presentationData)
|
let processedView = CallListNodeView(originalView: update.view, filteredEntries: callListNodeEntriesForView(view: update.view, displayOpenNewCall: mode == .tab && type == .all, groupCalls: groupCalls, state: state, showSettings: showSettings, showCallsTab: showCallsTab, isRecentCalls: type == .all, currentGroupCallPeerId: currentGroupCallPeerId), presentationData: state.presentationData)
|
||||||
let previous = previousView.swap(processedView)
|
let previous = previousView.swap(processedView)
|
||||||
let previousType = previousType.swap(type)
|
let previousType = previousType.swap(type)
|
||||||
|
|
||||||
|
@ -517,6 +517,7 @@ public final class CallController: ViewController {
|
|||||||
},
|
},
|
||||||
options: .single(options),
|
options: .single(options),
|
||||||
displayCallIcons: true,
|
displayCallIcons: true,
|
||||||
|
multipleSelection: .disabled,
|
||||||
confirmation: { peer in
|
confirmation: { peer in
|
||||||
switch peer {
|
switch peer {
|
||||||
case let .peer(peer, _, _):
|
case let .peer(peer, _, _):
|
||||||
|
@ -2706,6 +2706,15 @@ final class VideoChatScreenComponent: Component {
|
|||||||
} else if let expandedParticipantsVideoState = self.expandedParticipantsVideoState, !expandedParticipantsVideoState.isUIHidden {
|
} else if let expandedParticipantsVideoState = self.expandedParticipantsVideoState, !expandedParticipantsVideoState.isUIHidden {
|
||||||
displayVideoControlButton = false
|
displayVideoControlButton = false
|
||||||
}
|
}
|
||||||
|
if case .audio = videoControlButtonContent {
|
||||||
|
if let (availableOutputs, _) = self.audioOutputState {
|
||||||
|
if availableOutputs.count <= 0 {
|
||||||
|
displayVideoControlButton = false
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
displayVideoControlButton = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let videoControlButtonSize = self.videoControlButton.update(
|
let videoControlButtonSize = self.videoControlButton.update(
|
||||||
transition: transition,
|
transition: transition,
|
||||||
|
@ -1722,7 +1722,7 @@ final class StoryItemSetContainerSendMessage {
|
|||||||
case .contact:
|
case .contact:
|
||||||
let theme = component.theme
|
let theme = component.theme
|
||||||
let updatedPresentationData: (initial: PresentationData, signal: Signal<PresentationData, NoError>) = (component.context.sharedContext.currentPresentationData.with({ $0 }).withUpdated(theme: theme), component.context.sharedContext.presentationData |> map { $0.withUpdated(theme: theme) })
|
let updatedPresentationData: (initial: PresentationData, signal: Signal<PresentationData, NoError>) = (component.context.sharedContext.currentPresentationData.with({ $0 }).withUpdated(theme: theme), component.context.sharedContext.presentationData |> map { $0.withUpdated(theme: theme) })
|
||||||
let contactsController = component.context.sharedContext.makeContactSelectionController(ContactSelectionControllerParams(context: component.context, updatedPresentationData: updatedPresentationData, title: { $0.Contacts_Title }, displayDeviceContacts: true, multipleSelection: true))
|
let contactsController = component.context.sharedContext.makeContactSelectionController(ContactSelectionControllerParams(context: component.context, updatedPresentationData: updatedPresentationData, title: { $0.Contacts_Title }, displayDeviceContacts: true, multipleSelection: .always))
|
||||||
contactsController.presentScheduleTimePicker = { [weak self, weak view] completion in
|
contactsController.presentScheduleTimePicker = { [weak self, weak view] completion in
|
||||||
guard let self, let view else {
|
guard let self, let view else {
|
||||||
return
|
return
|
||||||
|
@ -2898,7 +2898,7 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if let currentGroupCallController = self.context.sharedContext as? VoiceChatController, case let .group(groupCall) = currentGroupCallController.call, let currentCallId = groupCall.callId, currentCallId == conferenceCall.callId {
|
if let currentGroupCallController = self.context.sharedContext.currentGroupCallController as? VoiceChatController, case let .group(groupCall) = currentGroupCallController.call, let currentCallId = groupCall.callId, currentCallId == conferenceCall.callId {
|
||||||
self.context.sharedContext.navigateToCurrentCall()
|
self.context.sharedContext.navigateToCurrentCall()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -424,7 +424,7 @@ extension ChatControllerImpl {
|
|||||||
let _ = currentLocationController.swap(controller)
|
let _ = currentLocationController.swap(controller)
|
||||||
})
|
})
|
||||||
case .contact:
|
case .contact:
|
||||||
let contactsController = ContactSelectionControllerImpl(ContactSelectionControllerParams(context: strongSelf.context, updatedPresentationData: strongSelf.updatedPresentationData, title: { $0.Contacts_Title }, displayDeviceContacts: true, multipleSelection: true, requirePhoneNumbers: true))
|
let contactsController = ContactSelectionControllerImpl(ContactSelectionControllerParams(context: strongSelf.context, updatedPresentationData: strongSelf.updatedPresentationData, title: { $0.Contacts_Title }, displayDeviceContacts: true, multipleSelection: .always, requirePhoneNumbers: true))
|
||||||
contactsController.presentScheduleTimePicker = { [weak self] completion in
|
contactsController.presentScheduleTimePicker = { [weak self] completion in
|
||||||
if let strongSelf = self {
|
if let strongSelf = self {
|
||||||
strongSelf.presentScheduleTimePicker(completion: completion)
|
strongSelf.presentScheduleTimePicker(completion: completion)
|
||||||
@ -1620,7 +1620,7 @@ extension ChatControllerImpl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func presentContactPicker() {
|
func presentContactPicker() {
|
||||||
let contactsController = ContactSelectionControllerImpl(ContactSelectionControllerParams(context: self.context, updatedPresentationData: self.updatedPresentationData, title: { $0.Contacts_Title }, displayDeviceContacts: true, multipleSelection: true))
|
let contactsController = ContactSelectionControllerImpl(ContactSelectionControllerParams(context: self.context, updatedPresentationData: self.updatedPresentationData, title: { $0.Contacts_Title }, displayDeviceContacts: true, multipleSelection: .always))
|
||||||
contactsController.navigationPresentation = .modal
|
contactsController.navigationPresentation = .modal
|
||||||
self.chatDisplayNode.dismissInput()
|
self.chatDisplayNode.dismissInput()
|
||||||
self.effectiveNavigationController?.pushViewController(contactsController)
|
self.effectiveNavigationController?.pushViewController(contactsController)
|
||||||
|
@ -40,7 +40,7 @@ class ContactSelectionControllerImpl: ViewController, ContactSelectionController
|
|||||||
private let options: Signal<[ContactListAdditionalOption], NoError>
|
private let options: Signal<[ContactListAdditionalOption], NoError>
|
||||||
private let displayDeviceContacts: Bool
|
private let displayDeviceContacts: Bool
|
||||||
private let displayCallIcons: Bool
|
private let displayCallIcons: Bool
|
||||||
private let multipleSelection: Bool
|
private let multipleSelection: ContactSelectionControllerParams.MultipleSelectionMode
|
||||||
private let requirePhoneNumbers: Bool
|
private let requirePhoneNumbers: Bool
|
||||||
private let allowChannelsInSearch: Bool
|
private let allowChannelsInSearch: Bool
|
||||||
|
|
||||||
@ -153,15 +153,17 @@ class ContactSelectionControllerImpl: ViewController, ContactSelectionController
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
if !params.multipleSelection {
|
if self.multipleSelection != .always {
|
||||||
self.searchContentNode = NavigationBarSearchContentNode(theme: self.presentationData.theme, placeholder: self.presentationData.strings.Common_Search, activate: { [weak self] in
|
self.searchContentNode = NavigationBarSearchContentNode(theme: self.presentationData.theme, placeholder: self.presentationData.strings.Common_Search, activate: { [weak self] in
|
||||||
self?.activateSearch()
|
self?.activateSearch()
|
||||||
})
|
})
|
||||||
self.navigationBar?.setContentNode(self.searchContentNode, animated: false)
|
self.navigationBar?.setContentNode(self.searchContentNode, animated: false)
|
||||||
}
|
}
|
||||||
|
|
||||||
if params.multipleSelection {
|
if self.multipleSelection == .always {
|
||||||
self.navigationItem.rightBarButtonItem = UIBarButtonItem(image: PresentationResourcesRootController.navigationCompactSearchIcon(self.presentationData.theme), style: .plain, target: self, action: #selector(self.beginSearch))
|
self.navigationItem.rightBarButtonItem = UIBarButtonItem(image: PresentationResourcesRootController.navigationCompactSearchIcon(self.presentationData.theme), style: .plain, target: self, action: #selector(self.beginSearch))
|
||||||
|
} else if self.multipleSelection == .possible {
|
||||||
|
self.navigationItem.rightBarButtonItem = UIBarButtonItem(title: self.presentationData.strings.Common_Select, style: .plain, target: self, action: #selector(self.beginSelection))
|
||||||
}
|
}
|
||||||
|
|
||||||
self.getCurrentSendMessageContextMediaPreview = { [weak self] in
|
self.getCurrentSendMessageContextMediaPreview = { [weak self] in
|
||||||
@ -220,7 +222,7 @@ class ContactSelectionControllerImpl: ViewController, ContactSelectionController
|
|||||||
}
|
}
|
||||||
|
|
||||||
override func loadDisplayNode() {
|
override func loadDisplayNode() {
|
||||||
self.displayNode = ContactSelectionControllerNode(context: self.context, mode: self.mode, presentationData: self.presentationData, options: self.options, displayDeviceContacts: self.displayDeviceContacts, displayCallIcons: self.displayCallIcons, multipleSelection: self.multipleSelection, requirePhoneNumbers: self.requirePhoneNumbers, allowChannelsInSearch: self.allowChannelsInSearch, isPeerEnabled: self.isPeerEnabled)
|
self.displayNode = ContactSelectionControllerNode(context: self.context, mode: self.mode, presentationData: self.presentationData, options: self.options, displayDeviceContacts: self.displayDeviceContacts, displayCallIcons: self.displayCallIcons, multipleSelection: self.multipleSelection == .always, requirePhoneNumbers: self.requirePhoneNumbers, allowChannelsInSearch: self.allowChannelsInSearch, isPeerEnabled: self.isPeerEnabled)
|
||||||
self._ready.set(self.contactsNode.contactListNode.ready)
|
self._ready.set(self.contactsNode.contactListNode.ready)
|
||||||
|
|
||||||
self.contactsNode.navigationBar = self.navigationBar
|
self.contactsNode.navigationBar = self.navigationBar
|
||||||
@ -335,7 +337,7 @@ class ContactSelectionControllerImpl: ViewController, ContactSelectionController
|
|||||||
if let searchContentNode = self.searchContentNode as? NavigationBarSearchContentNode {
|
if let searchContentNode = self.searchContentNode as? NavigationBarSearchContentNode {
|
||||||
self.contactsNode.activateSearch(placeholderNode: searchContentNode.placeholderNode)
|
self.contactsNode.activateSearch(placeholderNode: searchContentNode.placeholderNode)
|
||||||
self.setDisplayNavigationBar(false, transition: .animated(duration: 0.5, curve: .spring))
|
self.setDisplayNavigationBar(false, transition: .animated(duration: 0.5, curve: .spring))
|
||||||
} else if self.multipleSelection {
|
} else if self.multipleSelection == .always {
|
||||||
let contentNode = ContactsSearchNavigationContentNode(presentationData: self.presentationData, dismissSearch: { [weak self] in
|
let contentNode = ContactsSearchNavigationContentNode(presentationData: self.presentationData, dismissSearch: { [weak self] in
|
||||||
if let strongSelf = self, let navigationBar = strongSelf.navigationBar, let searchContentNode = strongSelf.searchContentNode as? ContactsSearchNavigationContentNode {
|
if let strongSelf = self, let navigationBar = strongSelf.navigationBar, let searchContentNode = strongSelf.searchContentNode as? ContactsSearchNavigationContentNode {
|
||||||
searchContentNode.deactivate()
|
searchContentNode.deactivate()
|
||||||
|
@ -394,6 +394,11 @@ func openResolvedUrlImpl(
|
|||||||
|
|
||||||
let _ = (signal
|
let _ = (signal
|
||||||
|> deliverOnMainQueue).startStandalone(next: { [weak navigationController] resolvedCallLink in
|
|> deliverOnMainQueue).startStandalone(next: { [weak navigationController] resolvedCallLink in
|
||||||
|
if let currentGroupCallController = context.sharedContext.currentGroupCallController as? VoiceChatController, case let .group(groupCall) = currentGroupCallController.call, let currentCallId = groupCall.callId, currentCallId == resolvedCallLink.id {
|
||||||
|
context.sharedContext.navigateToCurrentCall()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
navigationController?.pushViewController(context.sharedContext.makeJoinSubjectScreen(context: context, mode: JoinSubjectScreenMode.groupCall(JoinSubjectScreenMode.GroupCall(
|
navigationController?.pushViewController(context.sharedContext.makeJoinSubjectScreen(context: context, mode: JoinSubjectScreenMode.groupCall(JoinSubjectScreenMode.GroupCall(
|
||||||
id: resolvedCallLink.id,
|
id: resolvedCallLink.id,
|
||||||
accessHash: resolvedCallLink.accessHash,
|
accessHash: resolvedCallLink.accessHash,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user