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:
+3
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user