Files
Nearfield_Friends/Proximity/Models/ChatMessage.swift

27 lines
634 B
Swift
Raw Permalink Normal View History

import Foundation
/// A single end-to-end encrypted message within a revealed connection.
struct ChatMessage: Identifiable, Codable, Hashable {
let id: UUID
let connectionID: UUID
let senderID: String
let ciphertext: Data
let sentAt: Date
var deliveredAt: Date?
var readAt: Date?
init(
id: UUID = UUID(),
connectionID: UUID,
senderID: String,
ciphertext: Data,
sentAt: Date = Date()
) {
self.id = id
self.connectionID = connectionID
self.senderID = senderID
self.ciphertext = ciphertext
self.sentAt = sentAt
}
}