Various fixes

This commit is contained in:
Ilya Laktyushin
2024-03-18 21:45:36 +04:00
parent 0fc64aa505
commit a79644bf51
4 changed files with 14 additions and 5 deletions

View File

@@ -79,7 +79,7 @@ final class ContactMultiselectionControllerNode: ASDisplayNode {
private let isPeerEnabled: ((EnginePeer) -> Bool)?
private let onlyWriteable: Bool
init(navigationBar: NavigationBar?, context: AccountContext, presentationData: PresentationData, mode: ContactMultiselectionControllerMode, isPeerEnabled: ((EnginePeer) -> Bool)?, attemptDisabledItemSelection: ((EnginePeer, ChatListDisabledPeerReason) -> Void)?, options: [ContactListAdditionalOption], filters: [ContactListFilter], onlyWriteable: Bool, limit: Int32?, reachedSelectionLimit: ((Int32) -> Void)?) {
init(navigationBar: NavigationBar?, context: AccountContext, presentationData: PresentationData, mode: ContactMultiselectionControllerMode, isPeerEnabled: ((EnginePeer) -> Bool)?, attemptDisabledItemSelection: ((EnginePeer, ChatListDisabledPeerReason) -> Void)?, options: [ContactListAdditionalOption], filters: [ContactListFilter], onlyWriteable: Bool, limit: Int32?, reachedSelectionLimit: ((Int32) -> Void)?, present: @escaping (ViewController, Any?) -> Void) {
self.navigationBar = navigationBar
self.context = context
@@ -233,6 +233,13 @@ final class ContactMultiselectionControllerNode: ASDisplayNode {
}
self.openDisabledPeer?(peer, reason)
}
contactsNode.suppressPermissionWarning = { [weak self] in
if let strongSelf = self {
strongSelf.context.sharedContext.presentContactsWarningSuppression(context: strongSelf.context, present: { c, a in
present(c, a)
})
}
}
case let .chats(chatsNode):
chatsNode.peerSelected = { [weak self] peer, _, _, _, _ in
self?.openPeer?(.peer(peer: peer._asPeer(), isGlobal: false, participantCount: nil))