mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
- Story search UI
- Delete message confirmation
This commit is contained in:
@@ -64,14 +64,22 @@ func chatMessageDisplaySendMessageOptions(selfController: ChatControllerImpl, no
|
||||
editMessages = .single([])
|
||||
}
|
||||
|
||||
var currentMessageEffect: ChatSendMessageActionSheetControllerSendParameters.Effect?
|
||||
if selfController.presentationInterfaceState.interfaceState.editMessage == nil {
|
||||
if let sendMessageEffect = selfController.presentationInterfaceState.interfaceState.sendMessageEffect {
|
||||
currentMessageEffect = ChatSendMessageActionSheetControllerSendParameters.Effect(id: sendMessageEffect)
|
||||
}
|
||||
}
|
||||
|
||||
let _ = (combineLatest(
|
||||
selfController.context.account.viewTracker.peerView(peerId) |> take(1),
|
||||
effectItems,
|
||||
availableMessageEffects,
|
||||
hasPremium,
|
||||
editMessages
|
||||
editMessages,
|
||||
ChatSendMessageContextScreen.initialData(context: selfController.context, currentMessageEffectId: currentMessageEffect?.id)
|
||||
)
|
||||
|> deliverOnMainQueue).startStandalone(next: { [weak selfController] peerView, effectItems, availableMessageEffects, hasPremium, editMessages in
|
||||
|> deliverOnMainQueue).startStandalone(next: { [weak selfController] peerView, effectItems, availableMessageEffects, hasPremium, editMessages, initialData in
|
||||
guard let selfController, let peer = peerViewMainPeer(peerView) else {
|
||||
return
|
||||
}
|
||||
@@ -112,6 +120,7 @@ func chatMessageDisplaySendMessageOptions(selfController: ChatControllerImpl, no
|
||||
}
|
||||
|
||||
let controller = makeChatSendMessageActionSheetController(
|
||||
initialData: initialData,
|
||||
context: selfController.context,
|
||||
updatedPresentationData: selfController.updatedPresentationData,
|
||||
peerId: selfController.presentationInterfaceState.chatLocation.peerId,
|
||||
@@ -200,6 +209,7 @@ func chatMessageDisplaySendMessageOptions(selfController: ChatControllerImpl, no
|
||||
}
|
||||
|
||||
let controller = makeChatSendMessageActionSheetController(
|
||||
initialData: initialData,
|
||||
context: selfController.context,
|
||||
updatedPresentationData: selfController.updatedPresentationData,
|
||||
peerId: selfController.presentationInterfaceState.chatLocation.peerId,
|
||||
@@ -207,6 +217,16 @@ func chatMessageDisplaySendMessageOptions(selfController: ChatControllerImpl, no
|
||||
isScheduledMessages: false,
|
||||
mediaPreview: mediaPreview,
|
||||
mediaCaptionIsAbove: nil,
|
||||
messageEffect: (currentMessageEffect, { [weak selfController] updatedEffect in
|
||||
guard let selfController else {
|
||||
return
|
||||
}
|
||||
selfController.updateChatPresentationInterfaceState(transition: .immediate, interactive: true, { presentationInterfaceState in
|
||||
return presentationInterfaceState.updatedInterfaceState { interfaceState in
|
||||
return interfaceState.withUpdatedSendMessageEffect(updatedEffect?.id)
|
||||
}
|
||||
})
|
||||
}),
|
||||
attachment: false,
|
||||
canSendWhenOnline: sendWhenOnlineAvailable,
|
||||
forwardMessageIds: selfController.presentationInterfaceState.interfaceState.forwardMessageIds ?? []
|
||||
@@ -238,7 +258,7 @@ func chatMessageDisplaySendMessageOptions(selfController: ChatControllerImpl, no
|
||||
return
|
||||
}
|
||||
selfController.updateChatPresentationInterfaceState(animated: true, interactive: false, saveInterfaceState: selfController.presentationInterfaceState.subject != .scheduledMessages, {
|
||||
$0.updatedInterfaceState { $0.withUpdatedReplyMessageSubject(nil).withUpdatedForwardMessageIds(nil).withUpdatedForwardOptionsState(nil).withUpdatedComposeInputState(ChatTextInputState(inputText: NSAttributedString(string: ""))) }
|
||||
$0.updatedInterfaceState { $0.withUpdatedReplyMessageSubject(nil).withUpdatedSendMessageEffect(nil).withUpdatedForwardMessageIds(nil).withUpdatedForwardOptionsState(nil).withUpdatedComposeInputState(ChatTextInputState(inputText: NSAttributedString(string: ""))) }
|
||||
})
|
||||
selfController.openScheduledMessages()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user