From 4ae61dc4e1dcca6ae24131fcd9acc55124e3c0af Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Fri, 9 Oct 2026 12:16:51 +0200 Subject: feat: let the operator purge a group's chat (MNP 6.1) Signed chat_purge from the Chat settings deletes every stored message; epoch keys and attachments stay. The ack is broadcast so open chat panels empty. Co-Authored-By: Claude Opus 5.5 --- packages/meshbay-node/src/meshbay_node/chat/store.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'packages/meshbay-node/src/meshbay_node/chat') diff --git a/packages/meshbay-node/src/meshbay_node/chat/store.py b/packages/meshbay-node/src/meshbay_node/chat/store.py index 17cd68e..9e07aff 100644 --- a/packages/meshbay-node/src/meshbay_node/chat/store.py +++ b/packages/meshbay-node/src/meshbay_node/chat/store.py @@ -289,6 +289,12 @@ class ChatStore: await self._db.commit() return cursor.rowcount + async def delete_all(self) -> int: + """The operator's purge. Returns how many rows went.""" + cursor = await self._db.execute("DELETE FROM messages") + await self._db.commit() + return cursor.rowcount + async def message_count(self) -> int: cursor = await self._db.execute("SELECT COUNT(*) FROM messages") row = await cursor.fetchone() -- cgit v1.2.3