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

@ -1155,8 +1155,8 @@ private final class StickerPackContainer: ASDisplayNode {
controller.controllerNode.dismiss() controller.controllerNode.dismiss()
})) }))
items.append(ActionSheetButtonItem(title: "Add an Existing Sticker", color: .accent, action: { [weak actionSheet, weak self] in items.append(ActionSheetButtonItem(title: "Add an Existing Sticker", color: .accent, action: { [weak actionSheet, weak self] in
actionSheet?.dismissAnimated() actionSheet?.dismissAnimated()
guard let self, let controller = self.controller else { guard let self, let controller = self.controller else {
return return
} }

View File

@ -1337,7 +1337,7 @@ public final class ChatEntityKeyboardInputNode: ChatInputNode {
stickerPacks: [packReference], stickerPacks: [packReference],
loadedStickerPacks: [], loadedStickerPacks: [],
isEditing: true, isEditing: true,
parentNavigationController: nil, parentNavigationController: interaction.getNavigationController(),
sendSticker: { [weak interaction] fileReference, sourceView, sourceRect in sendSticker: { [weak interaction] fileReference, sourceView, sourceRect in
return interaction?.sendSticker(fileReference, false, false, nil, false, sourceView, sourceRect, nil, []) ?? false return interaction?.sendSticker(fileReference, false, false, nil, false, sourceView, sourceRect, nil, []) ?? false
} }

View File

@ -287,7 +287,9 @@ class ContactMultiselectionControllerImpl: ViewController, ContactMultiselection
} }
override func loadDisplayNode() { override func loadDisplayNode() {
self.displayNode = ContactMultiselectionControllerNode(navigationBar: self.navigationBar, context: self.context, presentationData: self.presentationData, mode: self.mode, isPeerEnabled: self.isPeerEnabled, attemptDisabledItemSelection: self.attemptDisabledItemSelection, options: self.options, filters: self.filters, onlyWriteable: self.onlyWriteable, limit: self.limit, reachedSelectionLimit: self.params.reachedLimit) self.displayNode = ContactMultiselectionControllerNode(navigationBar: self.navigationBar, context: self.context, presentationData: self.presentationData, mode: self.mode, isPeerEnabled: self.isPeerEnabled, attemptDisabledItemSelection: self.attemptDisabledItemSelection, options: self.options, filters: self.filters, onlyWriteable: self.onlyWriteable, limit: self.limit, reachedSelectionLimit: self.params.reachedLimit, present: { [weak self] c, a in
self?.present(c, in: .window(.root), with: a)
})
switch self.contactsNode.contentNode { switch self.contactsNode.contentNode {
case let .contacts(contactsNode): case let .contacts(contactsNode):
self._listReady.set(contactsNode.ready) self._listReady.set(contactsNode.ready)

View File

@ -79,7 +79,7 @@ final class ContactMultiselectionControllerNode: ASDisplayNode {
private let isPeerEnabled: ((EnginePeer) -> Bool)? private let isPeerEnabled: ((EnginePeer) -> Bool)?
private let onlyWriteable: 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.navigationBar = navigationBar
self.context = context self.context = context
@ -233,6 +233,13 @@ final class ContactMultiselectionControllerNode: ASDisplayNode {
} }
self.openDisabledPeer?(peer, reason) 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): case let .chats(chatsNode):
chatsNode.peerSelected = { [weak self] peer, _, _, _, _ in chatsNode.peerSelected = { [weak self] peer, _, _, _, _ in
self?.openPeer?(.peer(peer: peer._asPeer(), isGlobal: false, participantCount: nil)) self?.openPeer?(.peer(peer: peer._asPeer(), isGlobal: false, participantCount: nil))