fix(bots): intercept /confess so original never hits chat

Root cause of "not anonymous":
1. Confess deleted via raw SQL with no MESSAGE_DELETE broadcast
2. Frontend extractIds only accepted message_id, but deletes send id
   so live clients never removed deleted messages without refresh

Fix:
- Intercept /confess at message create: never store or broadcast the
  original; post only the anonymous bot message
- Accept both id and message_id on MESSAGE_DELETE in the WS store
- Include both fields on delete broadcasts
This commit is contained in:
2026-07-15 20:28:47 -04:00
parent 13bd4478f6
commit 7bf1eaf845
5 changed files with 165 additions and 78 deletions
+3 -1
View File
@@ -235,7 +235,9 @@ func main() {
// Messages (under channels)
r.Route("/channels/{channelID}/messages", func(r chi.Router) {
message.NewHandler(database.DB, hub, pushHandler, logger, permissionsChecker).RegisterRoutes(r)
msgHandler := message.NewHandler(database.DB, hub, pushHandler, logger, permissionsChecker)
msgHandler.SetConfessHandler(botRunner)
msgHandler.RegisterRoutes(r)
})
// Polls