diff --git a/Telegram/NotificationService/Sources/NotificationService.swift b/Telegram/NotificationService/Sources/NotificationService.swift index 5fcced7b3a..f79918f225 100644 --- a/Telegram/NotificationService/Sources/NotificationService.swift +++ b/Telegram/NotificationService/Sources/NotificationService.swift @@ -2013,6 +2013,15 @@ private final class NotificationServiceHandler { } |> deliverOn(strongSelf.queue)).start(completed: { UNUserNotificationCenter.current().getDeliveredNotifications(completionHandler: { notifications in + let notificationDebugList = notifications.map { notification -> String in + if let peerIdString = notification.request.content.userInfo["peerId"] as? String, let peerIdValue = Int64(peerIdString), let messageIdString = notification.request.content.userInfo["msg_id"] as? String, let messageIdValue = Int32(messageIdString) { + return "peerId: \(peerIdValue), messageId: \(messageIdValue)" + } else { + return "unknown: \(String(describing: notification.request.content.userInfo))" + } + }.joined(separator: "\n") + Logger.shared.log("NotificationService \(episode)", "Filtering delivered notifications: \(notificationDebugList)") + var removeIdentifiers: [String] = [] for notification in notifications { if let peerIdString = notification.request.content.userInfo["peerId"] as? String, let peerIdValue = Int64(peerIdString), let messageIdString = notification.request.content.userInfo["msg_id"] as? String, let messageIdValue = Int32(messageIdString) { diff --git a/submodules/TelegramCore/Sources/Utils/MessageUtils.swift b/submodules/TelegramCore/Sources/Utils/MessageUtils.swift index 1d3cb2680c..371dcbb67a 100644 --- a/submodules/TelegramCore/Sources/Utils/MessageUtils.swift +++ b/submodules/TelegramCore/Sources/Utils/MessageUtils.swift @@ -287,6 +287,8 @@ public extension Message { } else { return false } + } else if self.author?.id == accountPeerId { + return false } else if self.flags.contains(.Incoming) { return true } else if let channel = self.peers[self.id.peerId] as? TelegramChannel, case .broadcast = channel.info { diff --git a/submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryItemSetContainerComponent.swift b/submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryItemSetContainerComponent.swift index ae22b144ec..5598bab0db 100644 --- a/submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryItemSetContainerComponent.swift +++ b/submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryItemSetContainerComponent.swift @@ -430,6 +430,8 @@ public final class StoryItemSetContainerComponent: Component { let inputPanelContainer = SparseContainerView() private let inputPanelBackground = ComponentView() + var isUpdatingComponent: Bool = false + var preparingToDisplayViewList: Bool = false var viewListDisplayState: ViewListDisplayState = .hidden @@ -1510,7 +1512,7 @@ public final class StoryItemSetContainerComponent: Component { sharedState: component.storyItemSharedState, theme: component.theme, presentationProgressUpdated: { [weak self, weak visibleItem] progress, isBuffering, canSwitch in - guard let self = self, let component = self.component else { + guard let self, let component = self.component else { return } guard let visibleItem else { @@ -1526,7 +1528,7 @@ public final class StoryItemSetContainerComponent: Component { navigationStripView.updateCurrentItemProgress(value: progress, isBuffering: isBuffering, transition: .immediate) } - if isBufferingUpdated { + if isBufferingUpdated && !self.isUpdatingComponent { self.state?.updated(transition: .immediate) } @@ -2514,6 +2516,11 @@ public final class StoryItemSetContainerComponent: Component { } func update(component: StoryItemSetContainerComponent, availableSize: CGSize, state: EmptyComponentState, environment: Environment, transition: Transition) -> CGSize { + self.isUpdatingComponent = true + defer { + self.isUpdatingComponent = false + } + let isFirstTime = self.component == nil let startTime1 = CFAbsoluteTimeGetCurrent()