session-ios/SessionMessagingKit/Sending & Receiving/Quotes/OWSQuotedReplyModel+Conversion.swift
2020-11-27 13:52:20 +11:00

14 lines
449 B
Swift

extension VisibleMessage.Quote {
@objc(from:)
public static func from(_ quote: OWSQuotedReplyModel?) -> VisibleMessage.Quote? {
guard let quote = quote else { return nil }
let result = VisibleMessage.Quote()
result.timestamp = quote.timestamp
result.publicKey = quote.authorId
result.text = quote.body
result.attachmentID = quote.attachmentStream?.uniqueId
return result
}
}