initial commit: Proximity iOS app proposal, full Swift code scaffold, reference backend, testing docs, generated Xcode project
This commit is contained in:
26
Proximity/Models/ChatMessage.swift
Normal file
26
Proximity/Models/ChatMessage.swift
Normal file
@@ -0,0 +1,26 @@
|
||||
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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user