Add author id hash to database
This commit is contained in:
@@ -131,7 +131,7 @@ export class Database {
|
||||
const serializedMessage = serializeMessage(message);
|
||||
|
||||
await Database.db.run(`
|
||||
INSERT INTO messages (id, id_hash, author_id, author_name, channel_id, attachments, stickers, content) VALUES
|
||||
INSERT INTO messages (id, id_hash, author_id, author_id_hash, author_name, channel_id, attachments, stickers, content) VALUES
|
||||
(:id, :id_hash, :author_id, :author_name, :channel_id, :attachments, :stickers, :content)
|
||||
`, ...serializedMessage);
|
||||
|
||||
@@ -172,6 +172,10 @@ export class Database {
|
||||
await Database.db.run('DELETE from messages WHERE datetime(timestamp) < datetime("now", "-28 days")');
|
||||
}
|
||||
|
||||
static async purgeMessagesFrom(id: string) {
|
||||
await Database.db.run('DELETE from messages WHERE ');
|
||||
}
|
||||
|
||||
//#endregion
|
||||
|
||||
//#region Tickets
|
||||
|
||||
Vendored
+2
-1
@@ -1,7 +1,8 @@
|
||||
export type LoggedMessage = {
|
||||
id: string
|
||||
id_encrypted: string
|
||||
id_hash: string
|
||||
author_id: string
|
||||
author_id_hash: string
|
||||
author_name: string
|
||||
channel_id: string
|
||||
attachments: string
|
||||
|
||||
Reference in New Issue
Block a user