Update files

This commit is contained in:
glpshchn 2025-12-15 03:42:02 +03:00
parent bab6b49585
commit 3e89c8d42e
1 changed files with 5 additions and 8 deletions

View File

@ -36,18 +36,15 @@ def broadcast_online():
sio.emit('online', online_list, namespace='/mod-chat')
# Create namespace for moderation chat
mod_chat = sio.namespace('/mod-chat')
@mod_chat.on('connect')
# Namespace handlers for /mod-chat
@sio.on('connect', namespace='/mod-chat')
async def on_connect(sid, environ):
"""Handle client connection to /mod-chat namespace"""
logger.info(f"[WebSocket] Client connected to /mod-chat: {sid}")
# Don't authorize immediately - wait for 'auth' event
@mod_chat.on('disconnect')
@sio.on('disconnect', namespace='/mod-chat')
async def on_disconnect(sid):
"""Handle client disconnection"""
logger.info(f"[WebSocket] Client disconnected from /mod-chat: {sid}")
@ -57,7 +54,7 @@ async def on_disconnect(sid):
broadcast_online()
@mod_chat.on('auth')
@sio.on('auth', namespace='/mod-chat')
async def on_auth(sid, data):
"""Handle authentication for moderation chat"""
try:
@ -105,7 +102,7 @@ async def on_auth(sid, data):
await sio.disconnect(sid, namespace='/mod-chat')
@mod_chat.on('message')
@sio.on('message', namespace='/mod-chat')
async def on_message(sid, data):
"""Handle moderation chat message"""
try: