mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Update API [skip ci]
This commit is contained in:
@@ -1,20 +1,24 @@
|
||||
import Postbox
|
||||
|
||||
public final class TelegramMediaDice: Media {
|
||||
public let emoji: String
|
||||
public let value: Int32?
|
||||
|
||||
public let id: MediaId? = nil
|
||||
public let peerIds: [PeerId] = []
|
||||
|
||||
public init(value: Int32? = nil) {
|
||||
public init(emoji: String, value: Int32? = nil) {
|
||||
self.emoji = emoji
|
||||
self.value = value
|
||||
}
|
||||
|
||||
public init(decoder: PostboxDecoder) {
|
||||
self.emoji = decoder.decodeStringForKey("e", orElse: "🎲")
|
||||
self.value = decoder.decodeOptionalInt32ForKey("v")
|
||||
}
|
||||
|
||||
public func encode(_ encoder: PostboxEncoder) {
|
||||
encoder.encodeString(self.emoji, forKey: "e")
|
||||
if let value = self.value {
|
||||
encoder.encodeInt32(value, forKey: "v")
|
||||
} else {
|
||||
@@ -24,6 +28,9 @@ public final class TelegramMediaDice: Media {
|
||||
|
||||
public func isEqual(to other: Media) -> Bool {
|
||||
if let other = other as? TelegramMediaDice {
|
||||
if self.emoji != other.emoji {
|
||||
return false
|
||||
}
|
||||
if self.value != other.value {
|
||||
return false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user