aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-node/src/meshbay_node/chat
diff options
context:
space:
mode:
authorChristophe Besson <cbesson@gmail.com>2026-10-09 12:16:51 +0200
committerChristophe Besson <cbesson@gmail.com>2026-10-09 12:17:38 +0200
commit4ae61dc4e1dcca6ae24131fcd9acc55124e3c0af (patch)
tree44fd15f6175ade9b0b884f846dfd9d66e2b3bc80 /packages/meshbay-node/src/meshbay_node/chat
parent6832df6177ad973ad0e1b4f0a49d7a6da06c6e04 (diff)
downloadmeshbay-4ae61dc4e1dcca6ae24131fcd9acc55124e3c0af.tar.gz
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 <noreply@anthropic.com>
Diffstat (limited to 'packages/meshbay-node/src/meshbay_node/chat')
-rw-r--r--packages/meshbay-node/src/meshbay_node/chat/store.py6
1 files changed, 6 insertions, 0 deletions
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()