mv-experiment #1
|
@ -171,17 +171,22 @@ extension ClientMartinOMEMO: SignalIdentityKeyStoreProtocol {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// guard
|
do {
|
||||||
// let data = try! Database.main.reader({ database in
|
let record = try Database.shared.dbQueue.read { db in
|
||||||
// try database.select(query: .omemoKeyPairForAccount, params: ["account": account, "name": account.stringValue, "deviceId": deviceId]).mapFirst { $0.data(for: "key") }
|
try OMEMOIdentity
|
||||||
// })
|
.filter(Column("account") == credentials.bareJid)
|
||||||
// else {
|
.filter(Column("name") == credentials.bareJid)
|
||||||
// return nil
|
.filter(Column("deviceId") == deviceId)
|
||||||
// }
|
.fetchOne(db)
|
||||||
//
|
}
|
||||||
// return SignalIdentityKeyPair(fromKeyPairData: data)
|
guard let key = record?.key else {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
return SignalIdentityKeyPair(fromKeyPairData: key)
|
||||||
|
} catch {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func localRegistrationId() -> UInt32 {
|
func localRegistrationId() -> UInt32 {
|
||||||
if let settings = Settings.getFor(credentials.bareJid) {
|
if let settings = Settings.getFor(credentials.bareJid) {
|
||||||
|
|
Loading…
Reference in a new issue