mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-11-29 03:21:29 +00:00
Fix scheduled effectcs
(cherry picked from commit 586428cfa94e1a6d6dd3c29dd55f3ccca772c326)
This commit is contained in:
parent
3d82842ee1
commit
d1234b87fb
@ -573,7 +573,7 @@ final class ChatRecentActionsControllerNode: ViewControllerTracingNode {
|
|||||||
}
|
}
|
||||||
}, displayMessageTooltip: { _, _, _, _, _ in
|
}, displayMessageTooltip: { _, _, _, _, _ in
|
||||||
}, seekToTimecode: { _, _, _ in
|
}, seekToTimecode: { _, _, _ in
|
||||||
}, scheduleCurrentMessage: {
|
}, scheduleCurrentMessage: { _ in
|
||||||
}, sendScheduledMessagesNow: { _ in
|
}, sendScheduledMessagesNow: { _ in
|
||||||
}, editScheduledMessagesTime: { _ in
|
}, editScheduledMessagesTime: { _ in
|
||||||
}, performTextSelectionAction: { _, _, _, _ in
|
}, performTextSelectionAction: { _, _, _, _ in
|
||||||
|
|||||||
@ -442,7 +442,7 @@ public final class ChatSendGroupMediaMessageContextPreview: UIView, ChatSendMess
|
|||||||
}, openAppStorePage: {
|
}, openAppStorePage: {
|
||||||
}, displayMessageTooltip: { _, _, _, _, _ in
|
}, displayMessageTooltip: { _, _, _, _, _ in
|
||||||
}, seekToTimecode: { _, _, _ in
|
}, seekToTimecode: { _, _, _ in
|
||||||
}, scheduleCurrentMessage: {
|
}, scheduleCurrentMessage: { _ in
|
||||||
}, sendScheduledMessagesNow: { _ in
|
}, sendScheduledMessagesNow: { _ in
|
||||||
}, editScheduledMessagesTime: { _ in
|
}, editScheduledMessagesTime: { _ in
|
||||||
}, performTextSelectionAction: { _, _, _, _ in
|
}, performTextSelectionAction: { _, _, _, _ in
|
||||||
|
|||||||
@ -221,7 +221,7 @@ public final class ChatControllerInteraction: ChatControllerInteractionProtocol
|
|||||||
public let openAppStorePage: () -> Void
|
public let openAppStorePage: () -> Void
|
||||||
public let displayMessageTooltip: (MessageId, String, Bool, ASDisplayNode?, CGRect?) -> Void
|
public let displayMessageTooltip: (MessageId, String, Bool, ASDisplayNode?, CGRect?) -> Void
|
||||||
public let seekToTimecode: (Message, Double, Bool) -> Void
|
public let seekToTimecode: (Message, Double, Bool) -> Void
|
||||||
public let scheduleCurrentMessage: () -> Void
|
public let scheduleCurrentMessage: (ChatSendMessageActionSheetController.SendParameters?) -> Void
|
||||||
public let sendScheduledMessagesNow: ([MessageId]) -> Void
|
public let sendScheduledMessagesNow: ([MessageId]) -> Void
|
||||||
public let editScheduledMessagesTime: ([MessageId]) -> Void
|
public let editScheduledMessagesTime: ([MessageId]) -> Void
|
||||||
public let performTextSelectionAction: (Message?, Bool, NSAttributedString, TextSelectionAction) -> Void
|
public let performTextSelectionAction: (Message?, Bool, NSAttributedString, TextSelectionAction) -> Void
|
||||||
@ -350,7 +350,7 @@ public final class ChatControllerInteraction: ChatControllerInteractionProtocol
|
|||||||
openAppStorePage: @escaping () -> Void,
|
openAppStorePage: @escaping () -> Void,
|
||||||
displayMessageTooltip: @escaping (MessageId, String, Bool, ASDisplayNode?, CGRect?) -> Void,
|
displayMessageTooltip: @escaping (MessageId, String, Bool, ASDisplayNode?, CGRect?) -> Void,
|
||||||
seekToTimecode: @escaping (Message, Double, Bool) -> Void,
|
seekToTimecode: @escaping (Message, Double, Bool) -> Void,
|
||||||
scheduleCurrentMessage: @escaping () -> Void,
|
scheduleCurrentMessage: @escaping (ChatSendMessageActionSheetController.SendParameters?) -> Void,
|
||||||
sendScheduledMessagesNow: @escaping ([MessageId]) -> Void,
|
sendScheduledMessagesNow: @escaping ([MessageId]) -> Void,
|
||||||
editScheduledMessagesTime: @escaping ([MessageId]) -> Void,
|
editScheduledMessagesTime: @escaping ([MessageId]) -> Void,
|
||||||
performTextSelectionAction: @escaping (Message?, Bool, NSAttributedString, TextSelectionAction) -> Void,
|
performTextSelectionAction: @escaping (Message?, Bool, NSAttributedString, TextSelectionAction) -> Void,
|
||||||
|
|||||||
@ -3297,7 +3297,7 @@ final class PeerInfoScreenNode: ViewControllerTracingNode, PeerInfoScreenNodePro
|
|||||||
}, openAppStorePage: {
|
}, openAppStorePage: {
|
||||||
}, displayMessageTooltip: { _, _, _, _, _ in
|
}, displayMessageTooltip: { _, _, _, _, _ in
|
||||||
}, seekToTimecode: { _, _, _ in
|
}, seekToTimecode: { _, _, _ in
|
||||||
}, scheduleCurrentMessage: {
|
}, scheduleCurrentMessage: { _ in
|
||||||
}, sendScheduledMessagesNow: { _ in
|
}, sendScheduledMessagesNow: { _ in
|
||||||
}, editScheduledMessagesTime: { _ in
|
}, editScheduledMessagesTime: { _ in
|
||||||
}, performTextSelectionAction: { _, _, _, _ in
|
}, performTextSelectionAction: { _, _, _, _ in
|
||||||
|
|||||||
@ -244,11 +244,11 @@ func chatMessageDisplaySendMessageOptions(selfController: ChatControllerImpl, no
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
schedule: { [weak selfController] effect in
|
schedule: { [weak selfController] params in
|
||||||
guard let selfController else {
|
guard let selfController else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
selfController.controllerInteraction?.scheduleCurrentMessage()
|
selfController.controllerInteraction?.scheduleCurrentMessage(params)
|
||||||
}, openPremiumPaywall: { [weak selfController] c in
|
}, openPremiumPaywall: { [weak selfController] c in
|
||||||
guard let selfController else {
|
guard let selfController else {
|
||||||
return
|
return
|
||||||
|
|||||||
@ -3375,15 +3375,19 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, scheduleCurrentMessage: { [weak self] in
|
}, scheduleCurrentMessage: { [weak self] params in
|
||||||
if let strongSelf = self {
|
if let strongSelf = self {
|
||||||
strongSelf.presentScheduleTimePicker(completion: { [weak self] time in
|
strongSelf.presentScheduleTimePicker(completion: { [weak self] time in
|
||||||
if let strongSelf = self {
|
if let strongSelf = self {
|
||||||
if let _ = strongSelf.presentationInterfaceState.interfaceState.mediaDraftState {
|
if let _ = strongSelf.presentationInterfaceState.interfaceState.mediaDraftState {
|
||||||
strongSelf.sendMediaRecording(scheduleTime: time, messageEffect: nil)
|
strongSelf.sendMediaRecording(scheduleTime: time, messageEffect: (params?.effect).flatMap {
|
||||||
|
return ChatSendMessageEffect(id: $0.id)
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
let silentPosting = strongSelf.presentationInterfaceState.interfaceState.silentPosting
|
let silentPosting = strongSelf.presentationInterfaceState.interfaceState.silentPosting
|
||||||
strongSelf.chatDisplayNode.sendCurrentMessage(silentPosting: silentPosting, scheduleTime: time, messageEffect: nil) { [weak self] in
|
strongSelf.chatDisplayNode.sendCurrentMessage(silentPosting: silentPosting, scheduleTime: time, messageEffect: (params?.effect).flatMap {
|
||||||
|
return ChatSendMessageEffect(id: $0.id)
|
||||||
|
}) { [weak self] in
|
||||||
if let strongSelf = self {
|
if let strongSelf = self {
|
||||||
strongSelf.updateChatPresentationInterfaceState(animated: true, interactive: false, saveInterfaceState: strongSelf.presentationInterfaceState.subject != .scheduledMessages, {
|
strongSelf.updateChatPresentationInterfaceState(animated: true, interactive: false, saveInterfaceState: strongSelf.presentationInterfaceState.subject != .scheduledMessages, {
|
||||||
$0.updatedInterfaceState { $0.withUpdatedReplyMessageSubject(nil).withUpdatedForwardMessageIds(nil).withUpdatedForwardOptionsState(nil).withUpdatedComposeInputState(ChatTextInputState(inputText: NSAttributedString(string: ""))) }
|
$0.updatedInterfaceState { $0.withUpdatedReplyMessageSubject(nil).withUpdatedForwardMessageIds(nil).withUpdatedForwardOptionsState(nil).withUpdatedComposeInputState(ChatTextInputState(inputText: NSAttributedString(string: ""))) }
|
||||||
|
|||||||
@ -841,7 +841,7 @@ class ChatControllerNode: ASDisplayNode, ASScrollViewDelegate {
|
|||||||
self.textInputPanelNode?.sendMessage = { [weak self] in
|
self.textInputPanelNode?.sendMessage = { [weak self] in
|
||||||
if let strongSelf = self {
|
if let strongSelf = self {
|
||||||
if case .scheduledMessages = strongSelf.chatPresentationInterfaceState.subject, strongSelf.chatPresentationInterfaceState.editMessageState == nil {
|
if case .scheduledMessages = strongSelf.chatPresentationInterfaceState.subject, strongSelf.chatPresentationInterfaceState.editMessageState == nil {
|
||||||
strongSelf.controllerInteraction.scheduleCurrentMessage()
|
strongSelf.controllerInteraction.scheduleCurrentMessage(nil)
|
||||||
} else {
|
} else {
|
||||||
strongSelf.sendCurrentMessage()
|
strongSelf.sendCurrentMessage()
|
||||||
}
|
}
|
||||||
|
|||||||
@ -134,7 +134,7 @@ final class OverlayAudioPlayerControllerNode: ViewControllerTracingNode, ASGestu
|
|||||||
}, openAppStorePage: {
|
}, openAppStorePage: {
|
||||||
}, displayMessageTooltip: { _, _, _, _, _ in
|
}, displayMessageTooltip: { _, _, _, _, _ in
|
||||||
}, seekToTimecode: { _, _, _ in
|
}, seekToTimecode: { _, _, _ in
|
||||||
}, scheduleCurrentMessage: {
|
}, scheduleCurrentMessage: { _ in
|
||||||
}, sendScheduledMessagesNow: { _ in
|
}, sendScheduledMessagesNow: { _ in
|
||||||
}, editScheduledMessagesTime: { _ in
|
}, editScheduledMessagesTime: { _ in
|
||||||
}, performTextSelectionAction: { _, _, _, _ in
|
}, performTextSelectionAction: { _, _, _, _ in
|
||||||
|
|||||||
@ -1734,7 +1734,7 @@ public final class SharedAccountContextImpl: SharedAccountContext {
|
|||||||
}, openAppStorePage: {
|
}, openAppStorePage: {
|
||||||
}, displayMessageTooltip: { _, _, _, _, _ in
|
}, displayMessageTooltip: { _, _, _, _, _ in
|
||||||
}, seekToTimecode: { _, _, _ in
|
}, seekToTimecode: { _, _, _ in
|
||||||
}, scheduleCurrentMessage: {
|
}, scheduleCurrentMessage: { _ in
|
||||||
}, sendScheduledMessagesNow: { _ in
|
}, sendScheduledMessagesNow: { _ in
|
||||||
}, editScheduledMessagesTime: { _ in
|
}, editScheduledMessagesTime: { _ in
|
||||||
}, performTextSelectionAction: { _, _, _, _ in
|
}, performTextSelectionAction: { _, _, _, _ in
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user