mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-02 00:17:02 +00:00
Improve access challenge attempts data
This commit is contained in:
parent
9ef483f6d4
commit
0ad2a2ccab
@ -1,22 +1,14 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
public struct AccessChallengeAttempts: PostboxCoding, Equatable {
|
public struct AccessChallengeAttempts: Equatable {
|
||||||
public let count: Int32
|
public let count: Int32
|
||||||
public let timestamp: Int32
|
public var bootTimestamp: Int32
|
||||||
|
public var uptime: Int32
|
||||||
|
|
||||||
public init(count: Int32, timestamp: Int32) {
|
public init(count: Int32, bootTimestamp: Int32, uptime: Int32) {
|
||||||
self.count = count
|
self.count = count
|
||||||
self.timestamp = timestamp
|
self.bootTimestamp = bootTimestamp
|
||||||
}
|
self.uptime = uptime
|
||||||
|
|
||||||
public init(decoder: PostboxDecoder) {
|
|
||||||
self.count = decoder.decodeInt32ForKey("c", orElse: 0)
|
|
||||||
self.timestamp = decoder.decodeInt32ForKey("t", orElse: 0)
|
|
||||||
}
|
|
||||||
|
|
||||||
public func encode(_ encoder: PostboxEncoder) {
|
|
||||||
encoder.encodeInt32(self.count, forKey: "c")
|
|
||||||
encoder.encodeInt32(self.timestamp, forKey: "t")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user