Fix DM collapse on same second send

This commit is contained in:
Jack Kingsman
2026-03-16 14:53:48 -07:00
parent 04733b6a02
commit 370ff115b4
39 changed files with 310 additions and 142 deletions
+12
View File
@@ -109,6 +109,18 @@ class RawPacketRepository:
)
await db.conn.commit()
@staticmethod
async def get_linked_message_id(packet_id: int) -> int | None:
"""Return the linked message ID for a raw packet, if any."""
cursor = await db.conn.execute(
"SELECT message_id FROM raw_packets WHERE id = ?",
(packet_id,),
)
row = await cursor.fetchone()
if not row:
return None
return row["message_id"]
@staticmethod
async def prune_old_undecrypted(max_age_days: int) -> int:
"""Delete undecrypted packets older than max_age_days. Returns count deleted."""