mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-07-20 10:11:10 +00:00
Add scheduled messages post alert
This commit is contained in:
parent
5f207b4231
commit
a78224b965
@ -389,6 +389,47 @@ extension ChatControllerImpl {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if let message = messages.values.compactMap({ $0 }).first(where: { message in message.attributes.contains(where: { $0 is PublishedSuggestedPostMessageAttribute }) }), let attribute = message.attributes.first(where: { $0 is PublishedSuggestedPostMessageAttribute }) as? PublishedSuggestedPostMessageAttribute {
|
||||||
|
let commit = { [weak self] in
|
||||||
|
guard let self else {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
//TODO:localize
|
||||||
|
let titleString: String
|
||||||
|
let textString: String
|
||||||
|
switch attribute.currency {
|
||||||
|
case .stars:
|
||||||
|
titleString = "Stars Will Be Lost"
|
||||||
|
textString = "You won't receive **Stars** for this post if you delete it now. The post must remain visible for at least **24 hours** after publication."
|
||||||
|
case .ton:
|
||||||
|
titleString = "TON Will Be Lost"
|
||||||
|
textString = "You won't receive **TON** for this post if you delete it now. The post must remain visible for at least **24 hours** after publication."
|
||||||
|
}
|
||||||
|
self.present(standardTextAlertController(
|
||||||
|
theme: AlertControllerTheme(presentationData: self.presentationData),
|
||||||
|
title: titleString,
|
||||||
|
text: textString,
|
||||||
|
actions: [
|
||||||
|
TextAlertAction(type: .destructiveAction, title: "Delete Anyway", action: { [weak self] in
|
||||||
|
guard let self else {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
self.beginDeleteMessagesWithUndo(messageIds: messageIds, type: .forEveryone)
|
||||||
|
}),
|
||||||
|
TextAlertAction(type: .defaultAction, title: self.presentationData.strings.Common_Cancel, action: {})
|
||||||
|
],
|
||||||
|
actionLayout: .vertical,
|
||||||
|
parseMarkdown: true
|
||||||
|
), in: .window(.root))
|
||||||
|
}
|
||||||
|
if let contextController {
|
||||||
|
contextController.dismiss(completion: commit)
|
||||||
|
} else {
|
||||||
|
commit()
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
let actionSheet = ActionSheetController(presentationData: self.presentationData)
|
let actionSheet = ActionSheetController(presentationData: self.presentationData)
|
||||||
var items: [ActionSheetItem] = []
|
var items: [ActionSheetItem] = []
|
||||||
var personalPeerName: String?
|
var personalPeerName: String?
|
||||||
|
Loading…
x
Reference in New Issue
Block a user