diff --git a/Telegram-iOS/SharedNotificationManager.swift b/Telegram-iOS/SharedNotificationManager.swift index b18cd81d58..71b4fe126d 100644 --- a/Telegram-iOS/SharedNotificationManager.swift +++ b/Telegram-iOS/SharedNotificationManager.swift @@ -198,7 +198,6 @@ final class SharedNotificationManager { let aps = payload["aps"] as? [AnyHashable: Any] var readMessageId: MessageId? - var removedMessageId: MessageId? var isCall = false var isAnnouncement = false var isLocationPolling = false @@ -208,6 +207,7 @@ final class SharedNotificationManager { var body: String? var apnsSound: String? var configurationUpdate: (Int32, String, Int32, Data?)? + var messagesDeleted: [MessageId] = [] if let aps = aps, let alert = aps["alert"] as? String { if let range = alert.range(of: ": ") { title = String(alert[.. Void in transaction.applyIncomingReadMaxId(readMessageId) }).start() } + for messageId in messagesDeleted { + self.clearNotificationsManager?.append(messageId) + } + + if !messagesDeleted.isEmpty { + let _ = account.postbox.transaction(ignoreDisabled: true, { transaction -> Void in + transaction.deleteMessages(messagesDeleted) + }).start() + } + + if readMessageId != nil || !messagesDeleted.isEmpty { + self.clearNotificationsManager?.commitNow() + } + if let (datacenterId, host, port, secret) = configurationUpdate { account.network.mergeBackupDatacenterAddress(datacenterId: datacenterId, host: host, port: port, secret: secret) } diff --git a/submodules/Display b/submodules/Display index 108a074f74..99638081bf 160000 --- a/submodules/Display +++ b/submodules/Display @@ -1 +1 @@ -Subproject commit 108a074f74f7a41daa63502e061b55187adb9fbd +Subproject commit 99638081bfc74d7ed991a0f8668a40466189204b diff --git a/submodules/TelegramCore b/submodules/TelegramCore index 4fb2baa71e..2309c6b129 160000 --- a/submodules/TelegramCore +++ b/submodules/TelegramCore @@ -1 +1 @@ -Subproject commit 4fb2baa71e1b856d2904998d272bbca76909b71e +Subproject commit 2309c6b12992900b139a727e8ece824fe095b3be diff --git a/submodules/TelegramUI b/submodules/TelegramUI index 1998a756c9..d4df959464 160000 --- a/submodules/TelegramUI +++ b/submodules/TelegramUI @@ -1 +1 @@ -Subproject commit 1998a756c9f3fce2f3e253352221fdf3181e043a +Subproject commit d4df95946408d2f4a1507069991c0bf173acae12