mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-09-05 12:13:02 +00:00
Don't delay message deletion when not necessary
(cherry picked from commit ad4c5a181ba4b8739c83f3e5f47c2e0a8559c6a3)
This commit is contained in:
parent
ccf5ebb1e9
commit
eff4ad5e78
@ -340,6 +340,20 @@ extension ChatControllerImpl {
|
||||
}
|
||||
|
||||
func beginDeleteMessagesWithUndo(messageIds: Set<MessageId>, type: InteractiveMessagesDeletionType) {
|
||||
var deleteImmediately = false
|
||||
if case .forEveryone = type {
|
||||
deleteImmediately = true
|
||||
} else if case .scheduledMessages = self.presentationInterfaceState.subject {
|
||||
deleteImmediately = true
|
||||
} else if case .peer(self.context.account.peerId) = self.chatLocation {
|
||||
deleteImmediately = true
|
||||
}
|
||||
|
||||
if deleteImmediately {
|
||||
let _ = self.context.engine.messages.deleteMessagesInteractively(messageIds: Array(messageIds), type: type).startStandalone()
|
||||
return
|
||||
}
|
||||
|
||||
self.chatDisplayNode.historyNode.ignoreMessageIds = Set(messageIds)
|
||||
|
||||
let undoTitle = self.presentationData.strings.Chat_MessagesDeletedToast_Text(Int32(messageIds.count))
|
||||
|
Loading…
x
Reference in New Issue
Block a user