mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
Various improvements [skip ci]
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import Foundation
|
||||
import Postbox
|
||||
import TelegramApi
|
||||
|
||||
public final class PaidStarsMessageAttribute: Equatable, MessageAttribute {
|
||||
public let stars: StarsAmount
|
||||
|
||||
public init(stars: StarsAmount) {
|
||||
self.stars = stars
|
||||
}
|
||||
|
||||
required public init(decoder: PostboxDecoder) {
|
||||
self.stars = decoder.decodeCodable(StarsAmount.self, forKey: "s") ?? StarsAmount(value: 0, nanos: 0)
|
||||
}
|
||||
|
||||
public func encode(_ encoder: PostboxEncoder) {
|
||||
encoder.encodeCodable(self.stars, forKey: "s")
|
||||
}
|
||||
|
||||
public static func ==(lhs: PaidStarsMessageAttribute, rhs: PaidStarsMessageAttribute) -> Bool {
|
||||
return lhs.stars == rhs.stars
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user