Self-check key transparency.

This commit is contained in:
Michelle Tang
2026-02-02 14:12:16 -05:00
committed by GitHub
parent 853a37920c
commit cd925d5f53
14 changed files with 507 additions and 10 deletions

View File

@@ -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.