fix
This commit is contained in:
parent
3ac81fb3d7
commit
fa0381e238
|
@ -24,6 +24,8 @@ final class ClientMartinMessagesManager {
|
|||
print("---")
|
||||
#endif
|
||||
|
||||
// Try to recognize if message is omemo-encoded and decode it
|
||||
|
||||
if let msg = Message.map(message) {
|
||||
Task {
|
||||
do {
|
||||
|
|
|
@ -43,9 +43,12 @@ final class ClientMartinOMEMO {
|
|||
let regId = context.generateRegistrationId()
|
||||
let address = SignalAddress(name: credentials.bareJid, deviceId: Int32(regId))
|
||||
|
||||
var settings = Settings.getFor(credentials.bareJid)
|
||||
settings?.omemoRegId = Int(regId)
|
||||
settings?.save()
|
||||
if var settings = Settings.getFor(credentials.bareJid) {
|
||||
settings.omemoRegId = Int(regId)
|
||||
settings.save()
|
||||
} else {
|
||||
Settings(bareJid: credentials.bareJid, omemoRegId: Int(regId)).save()
|
||||
}
|
||||
|
||||
guard let keyPair = SignalIdentityKeyPair.generateKeyPair(context: context), let publicKey = keyPair.publicKey else {
|
||||
return false
|
||||
|
|
|
@ -63,15 +63,15 @@ extension Database {
|
|||
try db.create(table: "omemo_sessions", options: [.ifNotExists]) { table in
|
||||
table.column("account", .text).notNull()
|
||||
table.column("name", .text).notNull()
|
||||
table.column("device_id", .integer).notNull()
|
||||
table.column("deviceId", .integer).notNull()
|
||||
table.column("key", .text).notNull()
|
||||
table.primaryKey(["account", "name", "device_id"], onConflict: .replace)
|
||||
table.primaryKey(["account", "name", "deviceId"], onConflict: .replace)
|
||||
}
|
||||
|
||||
try db.create(table: "omemo_identities", options: [.ifNotExists]) { table in
|
||||
table.column("account", .text).notNull()
|
||||
table.column("name", .text).notNull()
|
||||
table.column("device_id", .integer).notNull()
|
||||
table.column("deviceId", .integer).notNull()
|
||||
table.column("fingerprint", .text).notNull()
|
||||
table.column("key", .blob).notNull()
|
||||
table.column("own", .integer).notNull()
|
||||
|
@ -98,7 +98,7 @@ extension Database {
|
|||
// table.add(column: "encryption", .text)
|
||||
// }
|
||||
//
|
||||
// try db.alter(table: "chat_history") { table in
|
||||
// try db.alter(table: "messages") { table in
|
||||
// table.add(column: "encryption", .integer)
|
||||
// table.add(column: "fingerprint", .text)
|
||||
// }
|
||||
|
|
Loading…
Reference in a new issue