mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-20 08:39:22 +01:00
Self-check key transparency.
This commit is contained in:
@@ -2234,6 +2234,7 @@ open class RecipientTable(context: Context, databaseHelper: SignalDatabase) : Da
|
||||
.values(NEEDS_PNI_SIGNATURE to 0)
|
||||
.run()
|
||||
|
||||
clearSelfKeyTransparencyData()
|
||||
SignalDatabase.pendingPniSignatureMessages.deleteAll()
|
||||
|
||||
db.setTransactionSuccessful()
|
||||
@@ -2262,6 +2263,10 @@ open class RecipientTable(context: Context, databaseHelper: SignalDatabase) : Da
|
||||
}
|
||||
}
|
||||
|
||||
if (id == Recipient.self().id) {
|
||||
clearSelfKeyTransparencyData()
|
||||
}
|
||||
|
||||
if (update(id, contentValuesOf(USERNAME to username))) {
|
||||
AppDependencies.databaseObserver.notifyRecipientChanged(id)
|
||||
rotateStorageId(id)
|
||||
@@ -4056,6 +4061,14 @@ open class RecipientTable(context: Context, databaseHelper: SignalDatabase) : Da
|
||||
.run()
|
||||
}
|
||||
|
||||
fun clearSelfKeyTransparencyData() {
|
||||
writableDatabase
|
||||
.update(TABLE_NAME)
|
||||
.values(KEY_TRANSPARENCY_DATA to null)
|
||||
.where("$ACI_COLUMN = ?", Recipient.self().requireAci().toString())
|
||||
.run()
|
||||
}
|
||||
|
||||
/**
|
||||
* Will update the database with the content values you specified. It will make an intelligent
|
||||
* query such that this will only return true if a row was *actually* updated.
|
||||
|
||||
Reference in New Issue
Block a user