initial commit: Proximity iOS app proposal, full Swift code scaffold, reference backend, testing docs, generated Xcode project
This commit is contained in:
35
Proximity/Models/Connection.swift
Normal file
35
Proximity/Models/Connection.swift
Normal file
@@ -0,0 +1,35 @@
|
||||
import Foundation
|
||||
|
||||
/// A fully revealed, mutually-consented connection between two present users.
|
||||
///
|
||||
/// Connections can **only** be created from a mutual `Encounter`. There is no
|
||||
/// path to create one online — you must have been physically near each other.
|
||||
struct Connection: Identifiable, Codable, Hashable {
|
||||
let id: UUID
|
||||
let encounterID: UUID
|
||||
let remoteUserID: String
|
||||
let displayName: String
|
||||
let createdAt: Date
|
||||
let lastMessageAt: Date?
|
||||
|
||||
/// The E2E session key used for this conversation.
|
||||
let sessionKeyID: String
|
||||
|
||||
init(
|
||||
id: UUID = UUID(),
|
||||
encounterID: UUID,
|
||||
remoteUserID: String,
|
||||
displayName: String,
|
||||
createdAt: Date = Date(),
|
||||
lastMessageAt: Date? = nil,
|
||||
sessionKeyID: String
|
||||
) {
|
||||
self.id = id
|
||||
self.encounterID = encounterID
|
||||
self.remoteUserID = remoteUserID
|
||||
self.displayName = displayName
|
||||
self.createdAt = createdAt
|
||||
self.lastMessageAt = lastMessageAt
|
||||
self.sessionKeyID = sessionKeyID
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user