mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
Remove corresponding share suggestion on chat deletion, leaving, archiving and contact removal
This commit is contained in:
@@ -9,7 +9,7 @@ import TelegramUIPreferences
|
||||
import ItemListUI
|
||||
import ItemListPeerItem
|
||||
import AccountContext
|
||||
import AppIntents
|
||||
import TelegramIntents
|
||||
import AccountUtils
|
||||
|
||||
private final class IntentsSettingsControllerArguments {
|
||||
@@ -268,7 +268,27 @@ public func intentsSettingsController(context: AccountContext) -> ViewController
|
||||
|
||||
let updateDisposable = MetaDisposable()
|
||||
let arguments = IntentsSettingsControllerArguments(context: context, updateSettings: { f in
|
||||
let _ = updateIntentsSettingsInteractively(accountManager: context.sharedContext.accountManager, f).start()
|
||||
let _ = updateIntentsSettingsInteractively(accountManager: context.sharedContext.accountManager, f).start(next: { previous, updated in
|
||||
guard let previous = previous, let updated = updated else {
|
||||
return
|
||||
}
|
||||
let accountPeerId = context.account.peerId
|
||||
if previous.contacts && !updated.contacts {
|
||||
deleteAllSendMessageIntents(accountPeerId: accountPeerId, subject: .contact)
|
||||
}
|
||||
if previous.savedMessages && !updated.savedMessages {
|
||||
deleteAllSendMessageIntents(accountPeerId: accountPeerId, subject: .savedMessages)
|
||||
}
|
||||
if previous.privateChats && !updated.privateChats {
|
||||
deleteAllSendMessageIntents(accountPeerId: accountPeerId, subject: .privateChat)
|
||||
}
|
||||
if previous.groups && !updated.groups {
|
||||
deleteAllSendMessageIntents(accountPeerId: accountPeerId, subject: .group)
|
||||
}
|
||||
if previous.account != updated.account, let previousAccount = previous.account {
|
||||
deleteAllSendMessageIntents(accountPeerId: previousAccount)
|
||||
}
|
||||
})
|
||||
}, resetAll: {
|
||||
let presentationData = context.sharedContext.currentPresentationData.with { $0 }
|
||||
let actionSheet = ActionSheetController(presentationData: presentationData)
|
||||
|
||||
Reference in New Issue
Block a user