Merge commit '7621e2f8dec938cf48181c8b10afc9b01f444e68' into beta

This commit is contained in:
Ilya Laktyushin
2025-12-06 02:17:48 +04:00
commit 8344b97e03
28070 changed files with 7995182 additions and 0 deletions
@@ -0,0 +1,45 @@
import Foundation
final class MutablePeerTimeoutAttributesView: MutablePostboxView {
fileprivate var minValue: (peerId: PeerId, timestamp: UInt32)?
init(postbox: PostboxImpl) {
self.minValue = postbox.peerTimeoutPropertiesTable.min()
}
func replay(postbox: PostboxImpl, transaction: PostboxTransaction) -> Bool {
var updated = false
if transaction.updatedPeerTimeoutAttributes {
let minValue = postbox.peerTimeoutPropertiesTable.min()
if self.minValue?.0 != minValue?.0 || self.minValue?.1 != minValue?.1 {
updated = true
self.minValue = minValue
}
}
return updated
}
func refreshDueToExternalTransaction(postbox: PostboxImpl) -> Bool {
let minValue = postbox.peerTimeoutPropertiesTable.min()
if self.minValue?.0 != minValue?.0 || self.minValue?.1 != minValue?.1 {
self.minValue = minValue
return true
} else {
return false
}
}
func immutableView() -> PostboxView {
return PeerTimeoutAttributesView(self)
}
}
public final class PeerTimeoutAttributesView: PostboxView {
public let minValue: (peerId: PeerId, timestamp: UInt32)?
init(_ view: MutablePeerTimeoutAttributesView) {
self.minValue = view.minValue
}
}