Websocket for contact deletion, radio contact deletion flag fix, resent message now appends sender name

This commit is contained in:
Jack Kingsman
2026-03-03 12:43:27 -08:00
parent 73d4647cfc
commit 8fa37fe6dc
6 changed files with 45 additions and 0 deletions
+13
View File
@@ -215,6 +215,19 @@ class ContactRepository:
)
await db.conn.commit()
@staticmethod
async def clear_on_radio_except(keep_keys: list[str]) -> None:
"""Set on_radio=False for all contacts NOT in keep_keys."""
if not keep_keys:
await db.conn.execute("UPDATE contacts SET on_radio = 0 WHERE on_radio = 1")
else:
placeholders = ",".join("?" * len(keep_keys))
await db.conn.execute(
f"UPDATE contacts SET on_radio = 0 WHERE on_radio = 1 AND public_key NOT IN ({placeholders})",
keep_keys,
)
await db.conn.commit()
@staticmethod
async def delete(public_key: str) -> None:
normalized = public_key.lower()