Events Office users have full moderation capabilities over all active event chats, even if they're not registered for those events.
- Events Office sees ALL active chats (not just ones they're registered for)
- Each chat shows message count and last message preview
- Badge indicator:
canModerate: true
- Click the 🗑️ trash icon that appears when hovering over any message
- Confirms before deletion
- Message is permanently removed from database
- All users will no longer see the deleted message
- Opens moderation menu (⚙️ gear icon in chat header)
- Click "Clear All Messages"
- Confirms before clearing
- Removes ALL messages from the chat history
- Chat remains open but starts fresh
- Opens moderation menu (⚙️ gear icon in chat header)
- Click "Close Chat"
- Confirms before closing
- Sets chat to inactive
- Users can no longer send messages
- Chat history remains visible but read-only
API endpoint: GET /api/chat-stats
Returns:
- Total number of active chats
- Total number of closed chats
- List of all active chats with message counts
GET /api/chat-stats - Get all chat statistics
POST /api/chat/:eventType/:eventId/close - Close a chat
DELETE /api/chat/:eventType/:eventId/messages/:messageId - Delete specific message
DELETE /api/chat/:eventType/:eventId/clear - Clear all messages
- Login as Events Office
- See Chat Button - You'll see all active event chats (not just your registered events)
- Open any chat - Click the floating chat button → select any chat
- Moderation Menu - Click the ⚙️ gear icon in the chat header
- Delete Messages - Hover over any message → click 🗑️ trash icon
- Manage Chat - Use moderation menu to clear or close chats
- Events Office: Full moderation on all chats
- Admin: Full moderation on all chats
- Regular Users: No moderation capabilities
- All moderation endpoints check user role
- Returns 403 Forbidden if user is not Events Office or Admin
- JWT token required for authentication
- Actions are logged in server console
- Login as Events Office user
- Open chat for any active event
- Verify you see:
- ⚙️ Gear icon in header (moderation menu)
- 🗑️ Trash icon on message hover
- Test actions:
- Delete a message
- Clear all messages
- Close the chat
- Deleted messages cannot be recovered
- Closed chats can be manually reactivated by running the chat activation script
- Chat statistics are useful for monitoring activity across all events
- Events Office can moderate even events they didn't create