mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2026-01-04 12:14:29 +00:00
Merge commit '2266e38d691b345f49ae3c2cf9cc669c808b31d6'
This commit is contained in:
@@ -3,20 +3,24 @@ import Postbox
|
||||
public final class CachedStickerQueryResult: PostboxCoding {
|
||||
public let items: [TelegramMediaFile]
|
||||
public let hash: Int32
|
||||
public let timestamp: Int32
|
||||
|
||||
public init(items: [TelegramMediaFile], hash: Int32) {
|
||||
public init(items: [TelegramMediaFile], hash: Int32, timestamp: Int32) {
|
||||
self.items = items
|
||||
self.hash = hash
|
||||
self.timestamp = timestamp
|
||||
}
|
||||
|
||||
public init(decoder: PostboxDecoder) {
|
||||
self.items = decoder.decodeObjectArrayForKey("it").map { $0 as! TelegramMediaFile }
|
||||
self.hash = decoder.decodeInt32ForKey("h", orElse: 0)
|
||||
self.timestamp = decoder.decodeInt32ForKey("t", orElse: 0)
|
||||
}
|
||||
|
||||
public func encode(_ encoder: PostboxEncoder) {
|
||||
encoder.encodeObjectArray(self.items, forKey: "it")
|
||||
encoder.encodeInt32(self.hash, forKey: "h")
|
||||
encoder.encodeInt32(self.timestamp, forKey: "t")
|
||||
}
|
||||
|
||||
public static func cacheKey(_ query: String) -> ValueBoxKey {
|
||||
|
||||
@@ -66,4 +66,8 @@ public struct ExportedInvitation: PostboxCoding, Equatable {
|
||||
public static func ==(lhs: ExportedInvitation, rhs: ExportedInvitation) -> Bool {
|
||||
return lhs.link == rhs.link && lhs.isPermanent == rhs.isPermanent && lhs.isRevoked == rhs.isRevoked && lhs.adminId == rhs.adminId && lhs.date == rhs.date && lhs.startDate == rhs.startDate && lhs.expireDate == rhs.expireDate && lhs.usageLimit == rhs.usageLimit && lhs.count == rhs.count
|
||||
}
|
||||
|
||||
public func withUpdated(isRevoked: Bool) -> ExportedInvitation {
|
||||
return ExportedInvitation(link: self.link, isPermanent: self.isPermanent, isRevoked: isRevoked, adminId: self.adminId, date: self.date, startDate: self.startDate, expireDate: self.expireDate, usageLimit: self.usageLimit, count: self.count)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,6 +74,7 @@ public struct Namespaces {
|
||||
public static let cachedContextResults: Int8 = 10
|
||||
public static let proximityNotificationStoredState: Int8 = 11
|
||||
public static let cachedPeerInvitationImporters: Int8 = 12
|
||||
public static let cachedPeerExportedInvitations: Int8 = 13
|
||||
}
|
||||
|
||||
public struct UnorderedItemList {
|
||||
|
||||
Reference in New Issue
Block a user