mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
Merge branches 'master' and 'master' of gitlab.com:peter-iakovlev/telegram-ios
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -430,6 +430,8 @@ public final class StoryItemSetContainerComponent: Component {
|
||||
let inputPanelContainer = SparseContainerView()
|
||||
private let inputPanelBackground = ComponentView<Empty>()
|
||||
|
||||
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<Empty>, transition: Transition) -> CGSize {
|
||||
self.isUpdatingComponent = true
|
||||
defer {
|
||||
self.isUpdatingComponent = false
|
||||
}
|
||||
|
||||
let isFirstTime = self.component == nil
|
||||
|
||||
let startTime1 = CFAbsoluteTimeGetCurrent()
|
||||
|
||||
Reference in New Issue
Block a user