Add endpoint for deleting raw packets of decrypted messages

This commit is contained in:
Jack Kingsman
2026-02-21 00:10:29 -08:00
parent 6d0505ade6
commit 11f07f3501
6 changed files with 135 additions and 13 deletions
+7
View File
@@ -801,6 +801,13 @@ class RawPacketRepository:
await db.conn.commit()
return cursor.rowcount
@staticmethod
async def purge_linked_to_messages() -> int:
"""Delete raw packets that are already linked to a stored message."""
cursor = await db.conn.execute("DELETE FROM raw_packets WHERE message_id IS NOT NULL")
await db.conn.commit()
return cursor.rowcount
@staticmethod
async def get_undecrypted_text_messages() -> list[tuple[int, bytes, int]]:
"""Get all undecrypted TEXT_MESSAGE packets as (id, data, timestamp) tuples.