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