mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Various improvements
This commit is contained in:
parent
c39fdb4463
commit
85b7ecac14
@ -1237,7 +1237,7 @@ extension ChatControllerImpl {
|
||||
}, messageCorrelationId)
|
||||
}
|
||||
|
||||
self.chatDisplayNode.sendMessages = { [weak self] messages, silentPosting, scheduleTime, isAnyMessageTextPartitioned in
|
||||
self.chatDisplayNode.sendMessages = { [weak self] messages, silentPosting, scheduleTime, isAnyMessageTextPartitioned, postpone in
|
||||
guard let strongSelf = self else {
|
||||
return
|
||||
}
|
||||
@ -1285,7 +1285,7 @@ extension ChatControllerImpl {
|
||||
}
|
||||
}
|
||||
|
||||
let transformedMessages = strongSelf.transformEnqueueMessages(messages, silentPosting: silentPosting ?? false, scheduleTime: scheduleTime)
|
||||
let transformedMessages = strongSelf.transformEnqueueMessages(messages, silentPosting: silentPosting ?? false, scheduleTime: scheduleTime, postpone: postpone)
|
||||
|
||||
var forwardedMessages: [[EnqueueMessage]] = []
|
||||
var forwardSourcePeerIds = Set<PeerId>()
|
||||
@ -2855,8 +2855,8 @@ extension ChatControllerImpl {
|
||||
}, deleteRecordedMedia: { [weak self] in
|
||||
self?.deleteMediaRecording()
|
||||
}, sendRecordedMedia: { [weak self] silentPosting, viewOnce in
|
||||
self?.presentPaidMessageAlertIfNeeded(count: 1, completion: { [weak self] _ in
|
||||
self?.sendMediaRecording(silentPosting: silentPosting, viewOnce: viewOnce)
|
||||
self?.presentPaidMessageAlertIfNeeded(count: 1, completion: { [weak self] postpone in
|
||||
self?.sendMediaRecording(silentPosting: silentPosting, viewOnce: viewOnce, postpone: postpone)
|
||||
})
|
||||
}, displayRestrictedInfo: { [weak self] subject, displayType in
|
||||
guard let strongSelf = self else {
|
||||
|
@ -488,7 +488,7 @@ extension ChatControllerImpl {
|
||||
self.updateDownButtonVisibility()
|
||||
}
|
||||
|
||||
func sendMediaRecording(silentPosting: Bool? = nil, scheduleTime: Int32? = nil, viewOnce: Bool = false, messageEffect: ChatSendMessageEffect? = nil) {
|
||||
func sendMediaRecording(silentPosting: Bool? = nil, scheduleTime: Int32? = nil, viewOnce: Bool = false, messageEffect: ChatSendMessageEffect? = nil, postpone: Bool = false) {
|
||||
self.chatDisplayNode.updateRecordedMediaDeleted(false)
|
||||
|
||||
guard let recordedMediaPreview = self.presentationInterfaceState.interfaceState.mediaDraftState else {
|
||||
@ -537,9 +537,9 @@ extension ChatControllerImpl {
|
||||
|
||||
let transformedMessages: [EnqueueMessage]
|
||||
if let silentPosting = silentPosting {
|
||||
transformedMessages = self.transformEnqueueMessages(messages, silentPosting: silentPosting)
|
||||
transformedMessages = self.transformEnqueueMessages(messages, silentPosting: silentPosting, postpone: postpone)
|
||||
} else if let scheduleTime = scheduleTime {
|
||||
transformedMessages = self.transformEnqueueMessages(messages, silentPosting: false, scheduleTime: scheduleTime)
|
||||
transformedMessages = self.transformEnqueueMessages(messages, silentPosting: false, scheduleTime: scheduleTime, postpone: postpone)
|
||||
} else {
|
||||
transformedMessages = self.transformEnqueueMessages(messages)
|
||||
}
|
||||
|
@ -2132,7 +2132,7 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
||||
shouldAnimateMessageTransition = true
|
||||
}
|
||||
|
||||
strongSelf.presentPaidMessageAlertIfNeeded(completion: { [weak self] _ in
|
||||
strongSelf.presentPaidMessageAlertIfNeeded(completion: { [weak self] postpone in
|
||||
guard let strongSelf = self else {
|
||||
return
|
||||
}
|
||||
@ -2205,17 +2205,17 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
||||
|
||||
let messages: [EnqueueMessage] = [.message(text: "", attributes: attributes, inlineStickers: [:], mediaReference: fileReference.abstract, threadId: strongSelf.chatLocation.threadId, replyToMessageId: strongSelf.presentationInterfaceState.interfaceState.replyMessageSubject?.subjectModel, replyToStoryId: nil, localGroupingKey: nil, correlationId: correlationId, bubbleUpEmojiOrStickersets: bubbleUpEmojiOrStickersets)]
|
||||
if silentPosting {
|
||||
let transformedMessages = strongSelf.transformEnqueueMessages(messages, silentPosting: silentPosting)
|
||||
let transformedMessages = strongSelf.transformEnqueueMessages(messages, silentPosting: silentPosting, postpone: postpone)
|
||||
strongSelf.sendMessages(transformedMessages)
|
||||
} else if schedule {
|
||||
strongSelf.presentScheduleTimePicker(completion: { [weak self] scheduleTime in
|
||||
if let strongSelf = self {
|
||||
let transformedMessages = strongSelf.transformEnqueueMessages(messages, silentPosting: false, scheduleTime: scheduleTime)
|
||||
let transformedMessages = strongSelf.transformEnqueueMessages(messages, silentPosting: false, scheduleTime: scheduleTime, postpone: postpone)
|
||||
strongSelf.sendMessages(transformedMessages)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
let transformedMessages = strongSelf.transformEnqueueMessages(messages)
|
||||
let transformedMessages = strongSelf.transformEnqueueMessages(messages, postpone: postpone)
|
||||
strongSelf.sendMessages(transformedMessages)
|
||||
}
|
||||
})
|
||||
@ -9039,9 +9039,9 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
||||
})
|
||||
}
|
||||
|
||||
func transformEnqueueMessages(_ messages: [EnqueueMessage]) -> [EnqueueMessage] {
|
||||
func transformEnqueueMessages(_ messages: [EnqueueMessage], postpone: Bool = false) -> [EnqueueMessage] {
|
||||
let silentPosting = self.presentationInterfaceState.interfaceState.silentPosting
|
||||
return transformEnqueueMessages(messages, silentPosting: silentPosting)
|
||||
return transformEnqueueMessages(messages, silentPosting: silentPosting, postpone: postpone)
|
||||
}
|
||||
|
||||
@discardableResult func dismissAllUndoControllers() -> UndoOverlayController? {
|
||||
@ -9204,7 +9204,7 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
||||
}
|
||||
}
|
||||
|
||||
func transformEnqueueMessages(_ messages: [EnqueueMessage], silentPosting: Bool, scheduleTime: Int32? = nil) -> [EnqueueMessage] {
|
||||
func transformEnqueueMessages(_ messages: [EnqueueMessage], silentPosting: Bool, scheduleTime: Int32? = nil, postpone: Bool = false) -> [EnqueueMessage] {
|
||||
var defaultReplyMessageSubject: EngineMessageReplySubject?
|
||||
switch self.chatLocation {
|
||||
case .peer:
|
||||
@ -9244,7 +9244,7 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
||||
var attributes = attributes
|
||||
|
||||
if let sendPaidMessageStars = self.presentationInterfaceState.sendPaidMessageStars {
|
||||
attributes.append(PaidStarsMessageAttribute(stars: sendPaidMessageStars, postponeSending: true))
|
||||
attributes.append(PaidStarsMessageAttribute(stars: sendPaidMessageStars, postponeSending: postpone))
|
||||
}
|
||||
|
||||
if silentPosting || scheduleTime != nil {
|
||||
@ -9281,7 +9281,7 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
||||
return .single(false)
|
||||
}
|
||||
|
||||
func sendMessages(_ messages: [EnqueueMessage], media: Bool = false, commit: Bool = false) {
|
||||
func sendMessages(_ messages: [EnqueueMessage], media: Bool = false, postpone: Bool = false, commit: Bool = false) {
|
||||
if case let .customChatContents(customChatContents) = self.subject {
|
||||
customChatContents.enqueueMessages(messages: messages)
|
||||
return
|
||||
@ -9320,7 +9320,7 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
||||
if commit || !isScheduledMessages {
|
||||
self.commitPurposefulAction()
|
||||
|
||||
let _ = (enqueueMessages(account: self.context.account, peerId: peerId, messages: self.transformEnqueueMessages(messages))
|
||||
let _ = (enqueueMessages(account: self.context.account, peerId: peerId, messages: self.transformEnqueueMessages(messages, postpone: postpone))
|
||||
|> deliverOnMainQueue).startStandalone(next: { [weak self] _ in
|
||||
if let strongSelf = self, strongSelf.presentationInterfaceState.subject != .scheduledMessages {
|
||||
strongSelf.chatDisplayNode.historyNode.scrollToEndOfHistory()
|
||||
@ -9343,7 +9343,7 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
||||
} else {
|
||||
self.presentScheduleTimePicker(style: media ? .media : .default, dismissByTapOutside: false, completion: { [weak self] time in
|
||||
if let strongSelf = self {
|
||||
strongSelf.sendMessages(strongSelf.transformEnqueueMessages(messages, silentPosting: false, scheduleTime: time), commit: true)
|
||||
strongSelf.sendMessages(strongSelf.transformEnqueueMessages(messages, silentPosting: false, scheduleTime: time, postpone: postpone), commit: true)
|
||||
}
|
||||
})
|
||||
}
|
||||
@ -9352,15 +9352,15 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
||||
|
||||
func enqueueMediaMessages(fromGallery: Bool = false, signals: [Any]?, silentPosting: Bool, scheduleTime: Int32? = nil, parameters: ChatSendMessageActionSheetController.SendParameters? = nil, getAnimatedTransitionSource: ((String) -> UIView?)? = nil, completion: @escaping () -> Void = {}) {
|
||||
if let _ = self.presentationInterfaceState.sendPaidMessageStars {
|
||||
self.presentPaidMessageAlertIfNeeded(count: Int32(signals?.count ?? 1), forceDark: fromGallery, completion: { [weak self] _ in
|
||||
self?.commitEnqueueMediaMessages(signals: signals, silentPosting: silentPosting, scheduleTime: scheduleTime, parameters: parameters, getAnimatedTransitionSource: getAnimatedTransitionSource, completion: completion)
|
||||
self.presentPaidMessageAlertIfNeeded(count: Int32(signals?.count ?? 1), forceDark: fromGallery, completion: { [weak self] postpone in
|
||||
self?.commitEnqueueMediaMessages(signals: signals, silentPosting: silentPosting, scheduleTime: scheduleTime, postpone: postpone, parameters: parameters, getAnimatedTransitionSource: getAnimatedTransitionSource, completion: completion)
|
||||
})
|
||||
} else {
|
||||
self.commitEnqueueMediaMessages(signals: signals, silentPosting: silentPosting, scheduleTime: scheduleTime, parameters: parameters, getAnimatedTransitionSource: getAnimatedTransitionSource, completion: completion)
|
||||
}
|
||||
}
|
||||
|
||||
private func commitEnqueueMediaMessages(signals: [Any]?, silentPosting: Bool, scheduleTime: Int32? = nil, parameters: ChatSendMessageActionSheetController.SendParameters? = nil, getAnimatedTransitionSource: ((String) -> UIView?)? = nil, completion: @escaping () -> Void = {}) {
|
||||
private func commitEnqueueMediaMessages(signals: [Any]?, silentPosting: Bool, scheduleTime: Int32? = nil, postpone: Bool = false, parameters: ChatSendMessageActionSheetController.SendParameters? = nil, getAnimatedTransitionSource: ((String) -> UIView?)? = nil, completion: @escaping () -> Void = {}) {
|
||||
self.enqueueMediaMessageDisposable.set((legacyAssetPickerEnqueueMessages(context: self.context, account: self.context.account, signals: signals!)
|
||||
|> deliverOnMainQueue).startStrict(next: { [weak self] items in
|
||||
guard let strongSelf = self else {
|
||||
@ -9493,7 +9493,7 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
||||
}
|
||||
}
|
||||
|
||||
let messages = strongSelf.transformEnqueueMessages(mappedMessages, silentPosting: silentPosting, scheduleTime: scheduleTime)
|
||||
let messages = strongSelf.transformEnqueueMessages(mappedMessages, silentPosting: silentPosting, scheduleTime: scheduleTime, postpone: postpone)
|
||||
let replyMessageSubject = strongSelf.presentationInterfaceState.interfaceState.replyMessageSubject
|
||||
strongSelf.chatDisplayNode.setupSendActionOnViewUpdate({
|
||||
if let strongSelf = self {
|
||||
|
@ -273,7 +273,7 @@ class ChatControllerNode: ASDisplayNode, ASScrollViewDelegate {
|
||||
|
||||
var requestUpdateChatInterfaceState: (ContainedViewLayoutTransition, Bool, (ChatInterfaceState) -> ChatInterfaceState) -> Void = { _, _, _ in }
|
||||
var requestUpdateInterfaceState: (ContainedViewLayoutTransition, Bool, (ChatPresentationInterfaceState) -> ChatPresentationInterfaceState) -> Void = { _, _, _ in }
|
||||
var sendMessages: ([EnqueueMessage], Bool?, Int32?, Bool) -> Void = { _, _, _, _ in }
|
||||
var sendMessages: ([EnqueueMessage], Bool?, Int32?, Bool, Bool) -> Void = { _, _, _, _, _ in }
|
||||
var displayAttachmentMenu: () -> Void = { }
|
||||
var paste: (ChatTextInputPanelPasteData) -> Void = { _ in }
|
||||
var updateTypingActivity: (Bool) -> Void = { _ in }
|
||||
@ -893,8 +893,8 @@ class ChatControllerNode: ASDisplayNode, ASScrollViewDelegate {
|
||||
count += 1
|
||||
}
|
||||
}
|
||||
controller.presentPaidMessageAlertIfNeeded(count: count, completion: { [weak self] _ in
|
||||
self?.sendCurrentMessage()
|
||||
controller.presentPaidMessageAlertIfNeeded(count: count, completion: { [weak self] postpone in
|
||||
self?.sendCurrentMessage(postpone: postpone)
|
||||
})
|
||||
} else {
|
||||
self.sendCurrentMessage()
|
||||
@ -4070,7 +4070,7 @@ class ChatControllerNode: ASDisplayNode, ASScrollViewDelegate {
|
||||
}
|
||||
}
|
||||
|
||||
func sendCurrentMessage(silentPosting: Bool? = nil, scheduleTime: Int32? = nil, messageEffect: ChatSendMessageEffect? = nil, completion: @escaping () -> Void = {}) {
|
||||
func sendCurrentMessage(silentPosting: Bool? = nil, scheduleTime: Int32? = nil, postpone: Bool = false, messageEffect: ChatSendMessageEffect? = nil, completion: @escaping () -> Void = {}) {
|
||||
if let textInputPanelNode = self.inputPanelNode as? ChatTextInputPanelNode {
|
||||
self.historyNode.justSentTextMessage = true
|
||||
|
||||
@ -4336,7 +4336,7 @@ class ChatControllerNode: ASDisplayNode, ASScrollViewDelegate {
|
||||
}, usedCorrelationId)
|
||||
completion()
|
||||
|
||||
self.sendMessages(messages, silentPosting, scheduleTime, messages.count > 1)
|
||||
self.sendMessages(messages, silentPosting, scheduleTime, messages.count > 1, postpone)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -352,8 +352,8 @@ extension ChatControllerImpl {
|
||||
return
|
||||
}
|
||||
let message: EnqueueMessage = .message(text: "", attributes: [], inlineStickers: [:], mediaReference: mediaReference, threadId: strongSelf.chatLocation.threadId, replyToMessageId: nil, replyToStoryId: nil, localGroupingKey: nil, correlationId: nil, bubbleUpEmojiOrStickersets: [])
|
||||
self.presentPaidMessageAlertIfNeeded(completion: { [weak self] _ in
|
||||
self?.sendMessages([message], media: true)
|
||||
self.presentPaidMessageAlertIfNeeded(completion: { [weak self] postpone in
|
||||
self?.sendMessages([message], media: true, postpone: postpone)
|
||||
})
|
||||
})
|
||||
if let controller = controller as? AttachmentFileControllerImpl {
|
||||
@ -399,7 +399,7 @@ extension ChatControllerImpl {
|
||||
let replyMessageSubject = strongSelf.presentationInterfaceState.interfaceState.replyMessageSubject
|
||||
let message: EnqueueMessage = .message(text: "", attributes: [], inlineStickers: [:], mediaReference: .standalone(media: location), threadId: strongSelf.chatLocation.threadId, replyToMessageId: replyMessageSubject?.subjectModel, replyToStoryId: nil, localGroupingKey: nil, correlationId: nil, bubbleUpEmojiOrStickersets: [])
|
||||
|
||||
strongSelf.presentPaidMessageAlertIfNeeded(completion: { [weak self] _ in
|
||||
strongSelf.presentPaidMessageAlertIfNeeded(completion: { [weak self] postpone in
|
||||
guard let strongSelf = self else {
|
||||
return
|
||||
}
|
||||
@ -412,7 +412,7 @@ extension ChatControllerImpl {
|
||||
})
|
||||
}
|
||||
}, nil)
|
||||
strongSelf.sendMessages([message])
|
||||
strongSelf.sendMessages([message], postpone: postpone)
|
||||
})
|
||||
})
|
||||
completion(controller, controller.mediaPickerContext)
|
||||
@ -492,7 +492,7 @@ extension ChatControllerImpl {
|
||||
return attributes
|
||||
}
|
||||
}
|
||||
strongSelf.presentPaidMessageAlertIfNeeded(completion: { [weak self] _ in
|
||||
strongSelf.presentPaidMessageAlertIfNeeded(completion: { [weak self] postpone in
|
||||
guard let strongSelf = self else {
|
||||
return
|
||||
}
|
||||
@ -566,11 +566,11 @@ extension ChatControllerImpl {
|
||||
}
|
||||
}
|
||||
enqueueMessages.append(.message(text: "", attributes: attributes, inlineStickers: [:], mediaReference: .standalone(media: media), threadId: strongSelf.chatLocation.threadId, replyToMessageId: replyMessageSubject?.subjectModel, replyToStoryId: nil, localGroupingKey: nil, correlationId: nil, bubbleUpEmojiOrStickersets: []))
|
||||
strongSelf.presentPaidMessageAlertIfNeeded(completion: { [weak self] _ in
|
||||
strongSelf.presentPaidMessageAlertIfNeeded(completion: { [weak self] postpone in
|
||||
guard let strongSelf = self else {
|
||||
return
|
||||
}
|
||||
strongSelf.sendMessages(strongSelf.transformEnqueueMessages(enqueueMessages, silentPosting: silent, scheduleTime: scheduleTime))
|
||||
strongSelf.sendMessages(strongSelf.transformEnqueueMessages(enqueueMessages, silentPosting: silent, scheduleTime: scheduleTime), postpone: postpone)
|
||||
})
|
||||
} else {
|
||||
let contactController = strongSelf.context.sharedContext.makeDeviceContactInfoController(context: ShareControllerAppAccountContext(context: strongSelf.context), environment: ShareControllerAppEnvironment(sharedContext: strongSelf.context.sharedContext), subject: .filter(peer: peerAndContactData.0, contactId: nil, contactData: contactData, completion: { peer, contactData in
|
||||
@ -596,11 +596,11 @@ extension ChatControllerImpl {
|
||||
enqueueMessages.append(textEnqueueMessage)
|
||||
}
|
||||
enqueueMessages.append(.message(text: "", attributes: [], inlineStickers: [:], mediaReference: .standalone(media: media), threadId: strongSelf.chatLocation.threadId, replyToMessageId: replyMessageSubject?.subjectModel, replyToStoryId: nil, localGroupingKey: nil, correlationId: nil, bubbleUpEmojiOrStickersets: []))
|
||||
strongSelf.presentPaidMessageAlertIfNeeded(completion: { [weak self] _ in
|
||||
strongSelf.presentPaidMessageAlertIfNeeded(completion: { [weak self] postpone in
|
||||
guard let strongSelf = self else {
|
||||
return
|
||||
}
|
||||
strongSelf.sendMessages(strongSelf.transformEnqueueMessages(enqueueMessages, silentPosting: silent, scheduleTime: scheduleTime))
|
||||
strongSelf.sendMessages(strongSelf.transformEnqueueMessages(enqueueMessages, silentPosting: silent, scheduleTime: scheduleTime), postpone: postpone)
|
||||
})
|
||||
}
|
||||
}), completed: nil, cancelled: nil)
|
||||
@ -1154,11 +1154,11 @@ extension ChatControllerImpl {
|
||||
})
|
||||
}
|
||||
}, nil)
|
||||
strongSelf.presentPaidMessageAlertIfNeeded(completion: { [weak self] _ in
|
||||
strongSelf.presentPaidMessageAlertIfNeeded(completion: { [weak self] postpone in
|
||||
guard let strongSelf = self else {
|
||||
return
|
||||
}
|
||||
strongSelf.sendMessages(messages)
|
||||
strongSelf.sendMessages(messages, postpone: postpone)
|
||||
})
|
||||
}
|
||||
}
|
||||
@ -1594,7 +1594,7 @@ extension ChatControllerImpl {
|
||||
}
|
||||
let replyMessageSubject = strongSelf.presentationInterfaceState.interfaceState.replyMessageSubject
|
||||
let message: EnqueueMessage = .message(text: "", attributes: [], inlineStickers: [:], mediaReference: .standalone(media: location), threadId: strongSelf.chatLocation.threadId, replyToMessageId: replyMessageSubject?.subjectModel, replyToStoryId: nil, localGroupingKey: nil, correlationId: nil, bubbleUpEmojiOrStickersets: [])
|
||||
strongSelf.presentPaidMessageAlertIfNeeded(completion: { [weak self] _ in
|
||||
strongSelf.presentPaidMessageAlertIfNeeded(completion: { [weak self] postpone in
|
||||
guard let strongSelf = self else {
|
||||
return
|
||||
}
|
||||
@ -1607,7 +1607,7 @@ extension ChatControllerImpl {
|
||||
})
|
||||
}
|
||||
}, nil)
|
||||
strongSelf.sendMessages([message])
|
||||
strongSelf.sendMessages([message], postpone: postpone)
|
||||
})
|
||||
})
|
||||
strongSelf.effectiveNavigationController?.pushViewController(controller)
|
||||
@ -1661,11 +1661,11 @@ extension ChatControllerImpl {
|
||||
enqueueMessages.append(message)
|
||||
}
|
||||
}
|
||||
strongSelf.presentPaidMessageAlertIfNeeded(completion: { [weak self] _ in
|
||||
strongSelf.presentPaidMessageAlertIfNeeded(completion: { [weak self] postpone in
|
||||
guard let strongSelf = self else {
|
||||
return
|
||||
}
|
||||
strongSelf.sendMessages(enqueueMessages)
|
||||
strongSelf.sendMessages(enqueueMessages, postpone: postpone)
|
||||
})
|
||||
} else if let peer = peers.first {
|
||||
let dataSignal: Signal<(Peer?, DeviceContactExtendedData?), NoError>
|
||||
@ -1724,11 +1724,11 @@ extension ChatControllerImpl {
|
||||
}
|
||||
}, nil)
|
||||
let message = EnqueueMessage.message(text: "", attributes: [], inlineStickers: [:], mediaReference: .standalone(media: media), threadId: strongSelf.chatLocation.threadId, replyToMessageId: replyMessageSubject?.subjectModel, replyToStoryId: nil, localGroupingKey: nil, correlationId: nil, bubbleUpEmojiOrStickersets: [])
|
||||
strongSelf.presentPaidMessageAlertIfNeeded(completion: { [weak self] _ in
|
||||
strongSelf.presentPaidMessageAlertIfNeeded(completion: { [weak self] postpone in
|
||||
guard let strongSelf = self else {
|
||||
return
|
||||
}
|
||||
strongSelf.sendMessages([message])
|
||||
strongSelf.sendMessages([message], postpone: postpone)
|
||||
})
|
||||
} else {
|
||||
let contactController = strongSelf.context.sharedContext.makeDeviceContactInfoController(context: ShareControllerAppAccountContext(context: strongSelf.context), environment: ShareControllerAppEnvironment(sharedContext: strongSelf.context.sharedContext), subject: .filter(peer: peerAndContactData.0, contactId: nil, contactData: contactData, completion: { peer, contactData in
|
||||
@ -1749,11 +1749,11 @@ extension ChatControllerImpl {
|
||||
}
|
||||
}, nil)
|
||||
let message = EnqueueMessage.message(text: "", attributes: [], inlineStickers: [:], mediaReference: .standalone(media: media), threadId: strongSelf.chatLocation.threadId, replyToMessageId: replyMessageSubject?.subjectModel, replyToStoryId: nil, localGroupingKey: nil, correlationId: nil, bubbleUpEmojiOrStickersets: [])
|
||||
strongSelf.presentPaidMessageAlertIfNeeded(completion: { [weak self] _ in
|
||||
strongSelf.presentPaidMessageAlertIfNeeded(completion: { [weak self] postpone in
|
||||
guard let strongSelf = self else {
|
||||
return
|
||||
}
|
||||
strongSelf.sendMessages([message])
|
||||
strongSelf.sendMessages([message], postpone: postpone)
|
||||
})
|
||||
}
|
||||
}), completed: nil, cancelled: nil)
|
||||
|
@ -322,7 +322,7 @@ final class ChatTextInputActionButtonsNode: ASDisplayNode, ChatSendMessageAction
|
||||
transition.updateFrame(node: self.backgroundNode, frame: backgroundFrame)
|
||||
self.backgroundNode.cornerRadius = backgroundSize.height / 2.0
|
||||
|
||||
transition.updateFrame(node: self.backdropNode, frame: CGRect(origin: CGPoint(x: -2.0, y: -2.0), size: CGSize(width: size.width + 12.0, height: size.height + 2.0)))
|
||||
transition.updateFrame(node: self.backdropNode, frame: CGRect(origin: CGPoint(x: -2.0, y: -2.0), size: CGSize(width: innerSize.width + 12.0, height: size.height + 2.0)))
|
||||
if let (rect, containerSize) = self.absoluteRect {
|
||||
self.backdropNode.update(rect: rect, within: containerSize)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user