mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
[WIP] UI
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import Foundation
|
||||
import Postbox
|
||||
|
||||
public class ForwardVideoTimestampAttribute: MessageAttribute {
|
||||
public let timestamp: Int32
|
||||
|
||||
public init(timestamp: Int32) {
|
||||
self.timestamp = timestamp
|
||||
}
|
||||
|
||||
required public init(decoder: PostboxDecoder) {
|
||||
self.timestamp = decoder.decodeInt32ForKey("timestamp", orElse: 0)
|
||||
}
|
||||
|
||||
public func encode(_ encoder: PostboxEncoder) {
|
||||
encoder.encodeInt32(self.timestamp, forKey: "timestamp")
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
import Foundation
|
||||
import Postbox
|
||||
|
||||
public class LocalMediaPlaybackInfoAttribute: MessageAttribute {
|
||||
public let data: Data
|
||||
|
||||
public init(data: Data) {
|
||||
self.data = data
|
||||
}
|
||||
|
||||
required public init(decoder: PostboxDecoder) {
|
||||
self.data = decoder.decodeDataForKey("d") ?? Data()
|
||||
}
|
||||
|
||||
public func encode(_ encoder: PostboxEncoder) {
|
||||
encoder.encodeData(self.data, forKey: "d")
|
||||
}
|
||||
}
|
||||
@@ -140,6 +140,7 @@ public struct Namespaces {
|
||||
public static let cachedPremiumGiftCodeOptions: Int8 = 42
|
||||
public static let cachedProfileGifts: Int8 = 43
|
||||
public static let recommendedBots: Int8 = 44
|
||||
public static let channelsForPublicReaction: Int8 = 45
|
||||
}
|
||||
|
||||
public struct UnorderedItemList {
|
||||
|
||||
@@ -113,10 +113,10 @@ public let telegramPostboxSeedConfiguration: SeedConfiguration = {
|
||||
break
|
||||
}
|
||||
}
|
||||
var derivedData: DerivedDataMessageAttribute?
|
||||
var previousDerivedData: DerivedDataMessageAttribute?
|
||||
for attribute in previous {
|
||||
if let attribute = attribute as? DerivedDataMessageAttribute {
|
||||
derivedData = attribute
|
||||
previousDerivedData = attribute
|
||||
break
|
||||
}
|
||||
}
|
||||
@@ -134,17 +134,16 @@ public let telegramPostboxSeedConfiguration: SeedConfiguration = {
|
||||
updated.append(audioTranscription)
|
||||
}
|
||||
}
|
||||
if let derivedData = derivedData {
|
||||
if let previousDerivedData {
|
||||
var found = false
|
||||
for i in 0 ..< updated.count {
|
||||
if let attribute = updated[i] as? DerivedDataMessageAttribute {
|
||||
updated[i] = derivedData
|
||||
if let _ = updated[i] as? DerivedDataMessageAttribute {
|
||||
found = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if !found {
|
||||
updated.append(derivedData)
|
||||
updated.append(previousDerivedData)
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user