mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-04-24 10:28:03 +01:00
Follow up Key Transparency changes
Co-authored-by: trevor-signal <131492920+trevor-signal@users.noreply.github.com>
This commit is contained in:
@@ -4,6 +4,14 @@ import type { AciString } from '../../types/ServiceId.std.js';
|
||||
import type { ReadableDB, WritableDB } from '../Interface.std.js';
|
||||
import { sql } from '../util.std.js';
|
||||
|
||||
export function getAllKTAcis(db: ReadableDB): Array<AciString> {
|
||||
const [query, params] = sql`
|
||||
SELECT aci
|
||||
FROM key_transparency_account_data
|
||||
`;
|
||||
return db.prepare(query, { pluck: true }).all<AciString>(params);
|
||||
}
|
||||
|
||||
export function getKTAccountData(
|
||||
db: ReadableDB,
|
||||
aci: AciString
|
||||
@@ -29,3 +37,9 @@ export function setKTAccountData(
|
||||
`;
|
||||
db.prepare(query).run(params);
|
||||
}
|
||||
|
||||
export function removeAllKTAccountData(db: WritableDB): void {
|
||||
db.exec(`
|
||||
DELETE FROM key_transparency_account_data;
|
||||
`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user