mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Refactoring
This commit is contained in:
parent
e69e0a33dd
commit
3edd84cf95
@ -6119,9 +6119,10 @@ public final class VoiceChatControllerImpl: ViewController, VoiceChatController
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
let _ = (self.context.account.postbox.transaction { transaction -> (Peer?, SearchBotsConfiguration) in
|
let _ = (self.context.engine.data.get(
|
||||||
return (transaction.getPeer(peerId), currentSearchBotsConfiguration(transaction: transaction))
|
TelegramEngine.EngineData.Item.Peer.Peer(id: peerId),
|
||||||
}
|
TelegramEngine.EngineData.Item.Configuration.SearchBots()
|
||||||
|
)
|
||||||
|> deliverOnMainQueue).start(next: { [weak self] peer, searchBotsConfiguration in
|
|> deliverOnMainQueue).start(next: { [weak self] peer, searchBotsConfiguration in
|
||||||
guard let strongSelf = self, let peer = peer else {
|
guard let strongSelf = self, let peer = peer else {
|
||||||
return
|
return
|
||||||
@ -6167,7 +6168,7 @@ public final class VoiceChatControllerImpl: ViewController, VoiceChatController
|
|||||||
guard let strongSelf = self else {
|
guard let strongSelf = self else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
let controller = WebSearchController(context: strongSelf.context, peer: EnginePeer(peer), chatLocation: nil, configuration: searchBotsConfiguration, mode: .avatar(initialQuery: peer.id.namespace == Namespaces.Peer.CloudUser ? nil : EnginePeer(peer).displayTitle(strings: presentationData.strings, displayOrder: presentationData.nameDisplayOrder), completion: { [weak self] result in
|
let controller = WebSearchController(context: strongSelf.context, peer: peer, chatLocation: nil, configuration: searchBotsConfiguration, mode: .avatar(initialQuery: peer.id.namespace == Namespaces.Peer.CloudUser ? nil : peer.displayTitle(strings: presentationData.strings, displayOrder: presentationData.nameDisplayOrder), completion: { [weak self] result in
|
||||||
assetsController?.dismiss()
|
assetsController?.dismiss()
|
||||||
self?.updateProfilePhoto(result)
|
self?.updateProfilePhoto(result)
|
||||||
}))
|
}))
|
||||||
|
@ -125,6 +125,34 @@ public extension EngineConfiguration.UserLimits {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public extension EngineConfiguration {
|
||||||
|
struct SearchBots {
|
||||||
|
public var imageBotUsername: String?
|
||||||
|
public var gifBotUsername: String?
|
||||||
|
public var venueBotUsername: String?
|
||||||
|
|
||||||
|
public init(
|
||||||
|
imageBotUsername: String?,
|
||||||
|
gifBotUsername: String?,
|
||||||
|
venueBotUsername: String?
|
||||||
|
) {
|
||||||
|
self.imageBotUsername = imageBotUsername
|
||||||
|
self.gifBotUsername = gifBotUsername
|
||||||
|
self.venueBotUsername = venueBotUsername
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public extension EngineConfiguration.SearchBots {
|
||||||
|
init(_ configuration: SearchBotsConfiguration) {
|
||||||
|
self.init(
|
||||||
|
imageBotUsername: configuration.imageBotUsername,
|
||||||
|
gifBotUsername: configuration.gifBotUsername,
|
||||||
|
venueBotUsername: configuration.venueBotUsername
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public extension TelegramEngine.EngineData.Item {
|
public extension TelegramEngine.EngineData.Item {
|
||||||
enum Configuration {
|
enum Configuration {
|
||||||
public struct Limits: TelegramEngineDataItem, PostboxViewDataItem {
|
public struct Limits: TelegramEngineDataItem, PostboxViewDataItem {
|
||||||
@ -192,5 +220,25 @@ public extension TelegramEngine.EngineData.Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public struct SearchBots: TelegramEngineDataItem, PostboxViewDataItem {
|
||||||
|
public typealias Result = EngineConfiguration.SearchBots
|
||||||
|
|
||||||
|
public init() {
|
||||||
|
}
|
||||||
|
|
||||||
|
var key: PostboxViewKey {
|
||||||
|
return .preferences(keys: Set([PreferencesKeys.searchBotsConfiguration]))
|
||||||
|
}
|
||||||
|
|
||||||
|
func extract(view: PostboxView) -> Result {
|
||||||
|
guard let view = view as? PreferencesView else {
|
||||||
|
preconditionFailure()
|
||||||
|
}
|
||||||
|
guard let value = view.values[PreferencesKeys.searchBotsConfiguration]?.get(SearchBotsConfiguration.self) else {
|
||||||
|
return EngineConfiguration.SearchBots(SearchBotsConfiguration.defaultValue)
|
||||||
|
}
|
||||||
|
return EngineConfiguration.SearchBots(value)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -342,5 +342,32 @@ public extension TelegramEngine.EngineData.Item {
|
|||||||
return view.isContact
|
return view.isContact
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public struct StickerPack: TelegramEngineDataItem, PostboxViewDataItem {
|
||||||
|
public typealias Result = StickerPackCollectionInfo?
|
||||||
|
|
||||||
|
fileprivate var id: EnginePeer.Id
|
||||||
|
public var mapKey: EnginePeer.Id {
|
||||||
|
return self.id
|
||||||
|
}
|
||||||
|
|
||||||
|
public init(id: EnginePeer.Id) {
|
||||||
|
self.id = id
|
||||||
|
}
|
||||||
|
|
||||||
|
var key: PostboxViewKey {
|
||||||
|
return .cachedPeerData(peerId: self.id)
|
||||||
|
}
|
||||||
|
|
||||||
|
func extract(view: PostboxView) -> Result {
|
||||||
|
guard let view = view as? CachedPeerDataView else {
|
||||||
|
preconditionFailure()
|
||||||
|
}
|
||||||
|
guard let cachedData = view.cachedPeerData as? CachedChannelData else {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
return cachedData.stickerPack
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11747,7 +11747,7 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
|||||||
|
|
||||||
configureLegacyAssetPicker(controller, context: strongSelf.context, peer: peer, chatLocation: strongSelf.chatLocation, initialCaption: inputText, hasSchedule: strongSelf.presentationInterfaceState.subject != .scheduledMessages && peer.id.namespace != Namespaces.Peer.SecretChat, presentWebSearch: editingMedia ? nil : { [weak self, weak legacyController] in
|
configureLegacyAssetPicker(controller, context: strongSelf.context, peer: peer, chatLocation: strongSelf.chatLocation, initialCaption: inputText, hasSchedule: strongSelf.presentationInterfaceState.subject != .scheduledMessages && peer.id.namespace != Namespaces.Peer.SecretChat, presentWebSearch: editingMedia ? nil : { [weak self, weak legacyController] in
|
||||||
if let strongSelf = self {
|
if let strongSelf = self {
|
||||||
let controller = WebSearchController(context: strongSelf.context, updatedPresentationData: strongSelf.updatedPresentationData, peer: EnginePeer(peer), chatLocation: strongSelf.chatLocation, configuration: searchBotsConfiguration, mode: .media(attachment: false, completion: { results, selectionState, editingState, silentPosting in
|
let controller = WebSearchController(context: strongSelf.context, updatedPresentationData: strongSelf.updatedPresentationData, peer: EnginePeer(peer), chatLocation: strongSelf.chatLocation, configuration: EngineConfiguration.SearchBots(searchBotsConfiguration), mode: .media(attachment: false, completion: { results, selectionState, editingState, silentPosting in
|
||||||
if let legacyController = legacyController {
|
if let legacyController = legacyController {
|
||||||
legacyController.dismiss()
|
legacyController.dismiss()
|
||||||
}
|
}
|
||||||
@ -11850,13 +11850,7 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
let _ = (self.context.account.postbox.transaction { transaction -> SearchBotsConfiguration in
|
let _ = (self.context.engine.data.get(TelegramEngine.EngineData.Item.Configuration.SearchBots())
|
||||||
if let entry = transaction.getPreferencesEntry(key: PreferencesKeys.searchBotsConfiguration)?.get(SearchBotsConfiguration.self) {
|
|
||||||
return entry
|
|
||||||
} else {
|
|
||||||
return SearchBotsConfiguration.defaultValue
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|> deliverOnMainQueue).start(next: { [weak self] configuration in
|
|> deliverOnMainQueue).start(next: { [weak self] configuration in
|
||||||
if let strongSelf = self {
|
if let strongSelf = self {
|
||||||
let controller = WebSearchController(context: strongSelf.context, updatedPresentationData: strongSelf.updatedPresentationData, peer: EnginePeer(peer), chatLocation: strongSelf.chatLocation, configuration: configuration, mode: .media(attachment: attachment, completion: { [weak self] results, selectionState, editingState, silentPosting in
|
let controller = WebSearchController(context: strongSelf.context, updatedPresentationData: strongSelf.updatedPresentationData, peer: EnginePeer(peer), chatLocation: strongSelf.chatLocation, configuration: configuration, mode: .media(attachment: attachment, completion: { [weak self] results, selectionState, editingState, silentPosting in
|
||||||
|
@ -913,9 +913,7 @@ final class ChatMediaInputNode: ChatInputNode {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
let _ = (context.account.postbox.transaction { transaction -> StickerPackCollectionInfo? in
|
let _ = (context.engine.data.get(TelegramEngine.EngineData.Item.Peer.StickerPack(id: peerId))
|
||||||
return (transaction.getPeerCachedData(peerId: peerId) as? CachedChannelData)?.stickerPack
|
|
||||||
}
|
|
||||||
|> deliverOnMainQueue).start(next: { info in
|
|> deliverOnMainQueue).start(next: { info in
|
||||||
guard let strongSelf = self else {
|
guard let strongSelf = self else {
|
||||||
return
|
return
|
||||||
|
@ -305,9 +305,11 @@ public func createChannelController(context: AccountContext) -> ViewController {
|
|||||||
return state.editingName.composedTitle
|
return state.editingName.composedTitle
|
||||||
}
|
}
|
||||||
|
|
||||||
let _ = (context.account.postbox.transaction { transaction -> (Peer?, SearchBotsConfiguration) in
|
let _ = (context.engine.data.get(
|
||||||
return (transaction.getPeer(context.account.peerId), currentSearchBotsConfiguration(transaction: transaction))
|
TelegramEngine.EngineData.Item.Peer.Peer(id: context.account.peerId),
|
||||||
} |> deliverOnMainQueue).start(next: { peer, searchBotsConfiguration in
|
TelegramEngine.EngineData.Item.Configuration.SearchBots()
|
||||||
|
)
|
||||||
|
|> deliverOnMainQueue).start(next: { peer, searchBotsConfiguration in
|
||||||
let presentationData = context.sharedContext.currentPresentationData.with { $0 }
|
let presentationData = context.sharedContext.currentPresentationData.with { $0 }
|
||||||
|
|
||||||
let legacyController = LegacyController(presentation: .custom, theme: presentationData.theme)
|
let legacyController = LegacyController(presentation: .custom, theme: presentationData.theme)
|
||||||
@ -455,7 +457,7 @@ public func createChannelController(context: AccountContext) -> ViewController {
|
|||||||
let mixin = TGMediaAvatarMenuMixin(context: legacyController.context, parentController: emptyController, hasSearchButton: true, hasDeleteButton: stateValue.with({ $0.avatar }) != nil, hasViewButton: false, personalPhoto: false, isVideo: false, saveEditedPhotos: false, saveCapturedMedia: false, signup: false)!
|
let mixin = TGMediaAvatarMenuMixin(context: legacyController.context, parentController: emptyController, hasSearchButton: true, hasDeleteButton: stateValue.with({ $0.avatar }) != nil, hasViewButton: false, personalPhoto: false, isVideo: false, saveEditedPhotos: false, saveCapturedMedia: false, signup: false)!
|
||||||
let _ = currentAvatarMixin.swap(mixin)
|
let _ = currentAvatarMixin.swap(mixin)
|
||||||
mixin.requestSearchController = { assetsController in
|
mixin.requestSearchController = { assetsController in
|
||||||
let controller = WebSearchController(context: context, peer: peer.flatMap(EnginePeer.init), chatLocation: nil, configuration: searchBotsConfiguration, mode: .avatar(initialQuery: title, completion: { result in
|
let controller = WebSearchController(context: context, peer: peer, chatLocation: nil, configuration: searchBotsConfiguration, mode: .avatar(initialQuery: title, completion: { result in
|
||||||
assetsController?.dismiss()
|
assetsController?.dismiss()
|
||||||
completedChannelPhotoImpl(result)
|
completedChannelPhotoImpl(result)
|
||||||
}))
|
}))
|
||||||
|
@ -551,9 +551,10 @@ public func createGroupControllerImpl(context: AccountContext, peerIds: [PeerId]
|
|||||||
return state.editingName.composedTitle
|
return state.editingName.composedTitle
|
||||||
}
|
}
|
||||||
|
|
||||||
let _ = (context.account.postbox.transaction { transaction -> (Peer?, SearchBotsConfiguration) in
|
let _ = (context.engine.data.get(
|
||||||
return (transaction.getPeer(context.account.peerId), currentSearchBotsConfiguration(transaction: transaction))
|
TelegramEngine.EngineData.Item.Peer.Peer(id: context.account.peerId),
|
||||||
}
|
TelegramEngine.EngineData.Item.Configuration.SearchBots()
|
||||||
|
)
|
||||||
|> deliverOnMainQueue).start(next: { peer, searchBotsConfiguration in
|
|> deliverOnMainQueue).start(next: { peer, searchBotsConfiguration in
|
||||||
let presentationData = context.sharedContext.currentPresentationData.with { $0 }
|
let presentationData = context.sharedContext.currentPresentationData.with { $0 }
|
||||||
|
|
||||||
@ -703,7 +704,7 @@ public func createGroupControllerImpl(context: AccountContext, peerIds: [PeerId]
|
|||||||
let mixin = TGMediaAvatarMenuMixin(context: legacyController.context, parentController: emptyController, hasSearchButton: true, hasDeleteButton: stateValue.with({ $0.avatar }) != nil, hasViewButton: false, personalPhoto: false, isVideo: false, saveEditedPhotos: false, saveCapturedMedia: false, signup: false)!
|
let mixin = TGMediaAvatarMenuMixin(context: legacyController.context, parentController: emptyController, hasSearchButton: true, hasDeleteButton: stateValue.with({ $0.avatar }) != nil, hasViewButton: false, personalPhoto: false, isVideo: false, saveEditedPhotos: false, saveCapturedMedia: false, signup: false)!
|
||||||
let _ = currentAvatarMixin.swap(mixin)
|
let _ = currentAvatarMixin.swap(mixin)
|
||||||
mixin.requestSearchController = { assetsController in
|
mixin.requestSearchController = { assetsController in
|
||||||
let controller = WebSearchController(context: context, peer: peer.flatMap(EnginePeer.init), chatLocation: nil, configuration: searchBotsConfiguration, mode: .avatar(initialQuery: title, completion: { result in
|
let controller = WebSearchController(context: context, peer: peer, chatLocation: nil, configuration: searchBotsConfiguration, mode: .avatar(initialQuery: title, completion: { result in
|
||||||
assetsController?.dismiss()
|
assetsController?.dismiss()
|
||||||
completedGroupPhotoImpl(result)
|
completedGroupPhotoImpl(result)
|
||||||
}))
|
}))
|
||||||
|
@ -190,20 +190,25 @@ func openChatMessageImpl(_ params: OpenChatMessageParams) -> Bool {
|
|||||||
case let .other(otherMedia):
|
case let .other(otherMedia):
|
||||||
params.dismissInput()
|
params.dismissInput()
|
||||||
if let contact = otherMedia as? TelegramMediaContact {
|
if let contact = otherMedia as? TelegramMediaContact {
|
||||||
let _ = (params.context.account.postbox.transaction { transaction -> (Peer?, Bool?) in
|
let paramsSignal: Signal<(EnginePeer?, Bool), NoError>
|
||||||
if let peerId = contact.peerId {
|
if let peerId = contact.peerId {
|
||||||
return (transaction.getPeer(peerId), transaction.isPeerContact(peerId: peerId))
|
paramsSignal = params.context.engine.data.get(
|
||||||
} else {
|
TelegramEngine.EngineData.Item.Peer.Peer(id: peerId),
|
||||||
return (nil, nil)
|
TelegramEngine.EngineData.Item.Peer.IsContact(id: peerId)
|
||||||
}
|
)
|
||||||
} |> deliverOnMainQueue).start(next: { peer, isContact in
|
} else {
|
||||||
|
paramsSignal = .single((nil, false))
|
||||||
|
}
|
||||||
|
|
||||||
|
let _ = (paramsSignal
|
||||||
|
|> deliverOnMainQueue).start(next: { peer, isContact in
|
||||||
let contactData: DeviceContactExtendedData
|
let contactData: DeviceContactExtendedData
|
||||||
if let vCard = contact.vCardData, let vCardData = vCard.data(using: .utf8), let parsed = DeviceContactExtendedData(vcard: vCardData) {
|
if let vCard = contact.vCardData, let vCardData = vCard.data(using: .utf8), let parsed = DeviceContactExtendedData(vcard: vCardData) {
|
||||||
contactData = parsed
|
contactData = parsed
|
||||||
} else {
|
} else {
|
||||||
contactData = DeviceContactExtendedData(basicData: DeviceContactBasicData(firstName: contact.firstName, lastName: contact.lastName, phoneNumbers: [DeviceContactPhoneNumberData(label: "_$!<Mobile>!$_", value: contact.phoneNumber)]), middleName: "", prefix: "", suffix: "", organization: "", jobTitle: "", department: "", emailAddresses: [], urls: [], addresses: [], birthdayDate: nil, socialProfiles: [], instantMessagingProfiles: [], note: "")
|
contactData = DeviceContactExtendedData(basicData: DeviceContactBasicData(firstName: contact.firstName, lastName: contact.lastName, phoneNumbers: [DeviceContactPhoneNumberData(label: "_$!<Mobile>!$_", value: contact.phoneNumber)]), middleName: "", prefix: "", suffix: "", organization: "", jobTitle: "", department: "", emailAddresses: [], urls: [], addresses: [], birthdayDate: nil, socialProfiles: [], instantMessagingProfiles: [], note: "")
|
||||||
}
|
}
|
||||||
let controller = deviceContactInfoController(context: params.context, updatedPresentationData: params.updatedPresentationData, subject: .vcard(peer, nil, contactData), completed: nil, cancelled: nil)
|
let controller = deviceContactInfoController(context: params.context, updatedPresentationData: params.updatedPresentationData, subject: .vcard(peer?._asPeer(), nil, contactData), completed: nil, cancelled: nil)
|
||||||
params.navigationController?.pushViewController(controller)
|
params.navigationController?.pushViewController(controller)
|
||||||
})
|
})
|
||||||
return true
|
return true
|
||||||
|
@ -498,11 +498,9 @@ func openExternalUrlImpl(context: AccountContext, urlContext: OpenURLContext, ur
|
|||||||
}
|
}
|
||||||
|
|
||||||
if let id = id, !id.isEmpty, let idValue = Int64(id), idValue > 0 {
|
if let id = id, !id.isEmpty, let idValue = Int64(id), idValue > 0 {
|
||||||
let _ = (context.account.postbox.transaction { transaction -> Peer? in
|
let _ = (context.engine.data.get(TelegramEngine.EngineData.Item.Peer.Peer(id: PeerId(namespace: Namespaces.Peer.CloudUser, id: PeerId.Id._internalFromInt64Value(idValue))))
|
||||||
return transaction.getPeer(PeerId(namespace: Namespaces.Peer.CloudUser, id: PeerId.Id._internalFromInt64Value(idValue)))
|
|
||||||
}
|
|
||||||
|> deliverOnMainQueue).start(next: { peer in
|
|> deliverOnMainQueue).start(next: { peer in
|
||||||
if let peer = peer, let controller = context.sharedContext.makePeerInfoController(context: context, updatedPresentationData: nil, peer: peer, mode: .generic, avatarInitiallyExpanded: false, fromChat: false, requestsContext: nil) {
|
if let peer = peer, let controller = context.sharedContext.makePeerInfoController(context: context, updatedPresentationData: nil, peer: peer._asPeer(), mode: .generic, avatarInitiallyExpanded: false, fromChat: false, requestsContext: nil) {
|
||||||
navigationController?.pushViewController(controller)
|
navigationController?.pushViewController(controller)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -5957,9 +5957,10 @@ final class PeerInfoScreenNode: ViewControllerTracingNode, UIScrollViewDelegate
|
|||||||
}
|
}
|
||||||
|
|
||||||
let peerId = self.peerId
|
let peerId = self.peerId
|
||||||
let _ = (self.context.account.postbox.transaction { transaction -> (Peer?, SearchBotsConfiguration) in
|
let _ = (self.context.engine.data.get(
|
||||||
return (transaction.getPeer(peerId), currentSearchBotsConfiguration(transaction: transaction))
|
TelegramEngine.EngineData.Item.Peer.Peer(id: peerId),
|
||||||
}
|
TelegramEngine.EngineData.Item.Configuration.SearchBots()
|
||||||
|
)
|
||||||
|> deliverOnMainQueue).start(next: { [weak self] peer, searchBotsConfiguration in
|
|> deliverOnMainQueue).start(next: { [weak self] peer, searchBotsConfiguration in
|
||||||
guard let strongSelf = self, let peer = peer else {
|
guard let strongSelf = self, let peer = peer else {
|
||||||
return
|
return
|
||||||
@ -6004,7 +6005,7 @@ final class PeerInfoScreenNode: ViewControllerTracingNode, UIScrollViewDelegate
|
|||||||
guard let strongSelf = self else {
|
guard let strongSelf = self else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
let controller = WebSearchController(context: strongSelf.context, updatedPresentationData: strongSelf.controller?.updatedPresentationData, peer: EnginePeer(peer), chatLocation: nil, configuration: searchBotsConfiguration, mode: .avatar(initialQuery: strongSelf.isSettings ? nil : EnginePeer(peer).displayTitle(strings: presentationData.strings, displayOrder: presentationData.nameDisplayOrder), completion: { [weak self] result in
|
let controller = WebSearchController(context: strongSelf.context, updatedPresentationData: strongSelf.controller?.updatedPresentationData, peer: peer, chatLocation: nil, configuration: searchBotsConfiguration, mode: .avatar(initialQuery: strongSelf.isSettings ? nil : peer.displayTitle(strings: presentationData.strings, displayOrder: presentationData.nameDisplayOrder), completion: { [weak self] result in
|
||||||
assetsController?.dismiss()
|
assetsController?.dismiss()
|
||||||
self?.updateProfilePhoto(result)
|
self?.updateProfilePhoto(result)
|
||||||
}))
|
}))
|
||||||
|
@ -129,7 +129,7 @@ public final class WebSearchController: ViewController {
|
|||||||
private let mode: WebSearchControllerMode
|
private let mode: WebSearchControllerMode
|
||||||
private let peer: EnginePeer?
|
private let peer: EnginePeer?
|
||||||
private let chatLocation: ChatLocation?
|
private let chatLocation: ChatLocation?
|
||||||
private let configuration: SearchBotsConfiguration
|
private let configuration: EngineConfiguration.SearchBots
|
||||||
|
|
||||||
private var controllerNode: WebSearchControllerNode {
|
private var controllerNode: WebSearchControllerNode {
|
||||||
return self.displayNode as! WebSearchControllerNode
|
return self.displayNode as! WebSearchControllerNode
|
||||||
@ -170,7 +170,7 @@ public final class WebSearchController: ViewController {
|
|||||||
|
|
||||||
public var searchingUpdated: (Bool) -> Void = { _ in }
|
public var searchingUpdated: (Bool) -> Void = { _ in }
|
||||||
|
|
||||||
public init(context: AccountContext, updatedPresentationData: (initial: PresentationData, signal: Signal<PresentationData, NoError>)? = nil, peer: EnginePeer?, chatLocation: ChatLocation?, configuration: SearchBotsConfiguration, mode: WebSearchControllerMode) {
|
public init(context: AccountContext, updatedPresentationData: (initial: PresentationData, signal: Signal<PresentationData, NoError>)? = nil, peer: EnginePeer?, chatLocation: ChatLocation?, configuration: EngineConfiguration.SearchBots, mode: WebSearchControllerMode) {
|
||||||
self.context = context
|
self.context = context
|
||||||
self.mode = mode
|
self.mode = mode
|
||||||
self.peer = peer
|
self.peer = peer
|
||||||
|
Loading…
x
Reference in New Issue
Block a user