Skip to content

Latest commit

 

History

History
88 lines (72 loc) · 3.02 KB

CHAT_MODERATION_GUIDE.md

File metadata and controls

88 lines (72 loc) · 3.02 KB

Chat Moderation Features for Events Office

Overview

Events Office users have full moderation capabilities over all active event chats, even if they're not registered for those events.

Features Available to Events Office/Admin

1. View All Active Chats

  • 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

2. Delete Individual Messages

  • 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

3. Clear All Messages

  • 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

4. Close Chat Early

  • 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

5. View Chat Statistics

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

API Endpoints

Moderation Endpoints (Events Office/Admin only)

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

How to Use

As Events Office User:

  1. Login as Events Office
  2. See Chat Button - You'll see all active event chats (not just your registered events)
  3. Open any chat - Click the floating chat button → select any chat
  4. Moderation Menu - Click the ⚙️ gear icon in the chat header
  5. Delete Messages - Hover over any message → click 🗑️ trash icon
  6. Manage Chat - Use moderation menu to clear or close chats

Permissions

  • Events Office: Full moderation on all chats
  • Admin: Full moderation on all chats
  • Regular Users: No moderation capabilities

Security

  • 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

Testing Moderation

  1. Login as Events Office user
  2. Open chat for any active event
  3. Verify you see:
    • ⚙️ Gear icon in header (moderation menu)
    • 🗑️ Trash icon on message hover
  4. Test actions:
    • Delete a message
    • Clear all messages
    • Close the chat

Notes

  • 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