mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
32 lines
952 B
Swift
32 lines
952 B
Swift
import Postbox
|
|
|
|
public final class ImportableDeviceContactData: Equatable, PostboxCoding {
|
|
public let firstName: String
|
|
public let lastName: String
|
|
|
|
public init(firstName: String, lastName: String) {
|
|
self.firstName = firstName
|
|
self.lastName = lastName
|
|
}
|
|
|
|
public init(decoder: PostboxDecoder) {
|
|
self.firstName = decoder.decodeStringForKey("f", orElse: "")
|
|
self.lastName = decoder.decodeStringForKey("l", orElse: "")
|
|
}
|
|
|
|
public func encode(_ encoder: PostboxEncoder) {
|
|
encoder.encodeString(self.firstName, forKey: "f")
|
|
encoder.encodeString(self.lastName, forKey: "l")
|
|
}
|
|
|
|
public static func ==(lhs: ImportableDeviceContactData, rhs: ImportableDeviceContactData) -> Bool {
|
|
if lhs.firstName != rhs.firstName {
|
|
return false
|
|
}
|
|
if lhs.lastName != rhs.lastName {
|
|
return false
|
|
}
|
|
return true
|
|
}
|
|
}
|