From f5e201af06557771c93ceccad9d5505c4aa06165 Mon Sep 17 00:00:00 2001 From: fmodf Date: Sat, 31 Aug 2024 12:16:00 +0200 Subject: [PATCH] wip --- .../AppData/Model/OMEMO.swift | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 ConversationsClassic/AppData/Model/OMEMO.swift diff --git a/ConversationsClassic/AppData/Model/OMEMO.swift b/ConversationsClassic/AppData/Model/OMEMO.swift new file mode 100644 index 0000000..ff2be0d --- /dev/null +++ b/ConversationsClassic/AppData/Model/OMEMO.swift @@ -0,0 +1,44 @@ +import Foundation +import GRDB +import Martin + +// MARK: - Session +struct OMEMOSession: Codable & Equatable, DatabaseValueConvertible { + static let databaseTableName = "omemo_sessions" + + let account: String + let name: String + let deviceId: Int + let key: String +} + +// MARK: - Identity +struct OMEMOIdentity: Codable & Equatable, DatabaseValueConvertible { + static let databaseTableName = "omemo_identities" + + let account: String + let name: String + let deviceId: Int + let fingerprint: String + let key: Data + let own: Bool + let status: Int +} + +// MARK: - PreKey +struct OMEMOPreKey: Codable & Equatable, DatabaseValueConvertible { + static let databaseTableName = "omemo_pre_keys" + + let account: String + let id: Int + let key: Data +} + +// MARK: - SignedPreKey +struct OMEMOSignedPreKey: Codable & Equatable, DatabaseValueConvertible { + static let databaseTableName = "omemo_signed_pre_keys" + + let account: String + let id: Int + let key: Data +}